I just ran a command
update sometable set col = '1';
by mistake without specifying the where condition.
Is it possible to recover the previous version of the table?
The line cmd.ExecuteNonQuery();
cmd.CommandText
CREATE TRIGGER subscription_trig_0 ON subscription AFTER INSERT AS UPDATE user_data SET msg_count=msg_count+1 FROM user_data
JOIN INSERTED ON user_data.id = INSERTED.recipient;
The exception:
Incorrect syntax near the keyword 'TRIGGER'.
Then using VS 2010, connected to the very same file (a mdf file) i run the query above and i get a success message. WTF!
I am using Ajax.BeginForm to post comment.
How should I update the Comments section area to incorporate this new comment?
I am displaying comments on the page using the typical "foreach(Comment comment in Model.Comments)"
Follow up to this question
This (similar version from old link) works in SQL Server 2008, however, Oracle is giving me trouble:
MERGE INTO wdm_test
USING ( select '10000000000000000000000000000000' Guid from DUAL ) val
ON ( wdm_test.Guid = val.Guid )
WHEN MATCHED THEN UPDATE SET test_column = null
WHEN NOT MATCHED THEN
INSERT (Guid, test_column)
VALUES ('10000000000000000000000000000000', null)
OUTPUT $action;
SQL Error: ORA-00933: SQL command not properly ended
Does Oracle not support OUTPUT $action;? If not, is there an alternative?
Hi friends, My problem is, i am using a Javascript calender in my datagrid in asp.net and wants to make update the date based on the selection on the calender's date while editing, which is not happening. Can any one help me to solve this problem. Code is as follows
<%#Container.DataItem("EventDate")%
<%--' Width="80"/ --%
'
I have written my own Jommla component for displaying particular information (for example car info: engine power, year and etc.).
Now I want to add a comments to my component.
Implementing comments by my own is too hard and it's not very safe.
Maybe someone had and experience integrating some existing joomla component for an own component?
Update:
Maybe I can copy-paste code of some existing joomla comments component in my own component?
Does somebody tried to do this?
Is there a way to automatically run the update command after issuing the Team - Share - Pull from default command from the menu? TortoiseHg has a configure repository option for the Synchronize command, but I believe this will only apply when using the Hg Explorer Integration.
Hey all,
i use some code for inline cell editing from Apples TaggedLocations Example and im now stuck.
At the demo Code they save the changes at textFieldDidEndEditing, this works because they asume to edit only the first element in a table view.
I have to edit every row at the table view, so my problem is how to get indexPath.row to update the correct object stored in a mutableArray.
Or did i miss something?
Thanks for your help!
Hi all,
I have a simple stupid question. Here's the problem, for years, my company has been using the old WURFL PHP API. Now, with the release of the new WURFL PHP API that promises a better performance, we want to use it.
What I want to ask is, how do I update the cache? Can I use the old *update_cache.php*?
Something strange is going on with NHibernate for me. I can select, and I can insert. But I can't do and update against MySql.
Here is my domain class
public class UserAccount
{
public virtual int Id { get; set; }
public virtual string UserName { get; set; }
public virtual string Password { get; set; }
public virtual bool Enabled { get; set; }
public virtual string FirstName { get; set; }
public virtual string LastName { get; set; }
public virtual string Phone { get; set; }
public virtual DateTime? DeletedDate { get; set; }
public virtual UserAccount DeletedBy { get; set; }
}
Fluent Mapping
public class UserAccountMap : ClassMap<UserAccount>
{
public UserAccountMap()
{
Table("UserAccount");
Id(x => x.Id);
Map(x => x.UserName);
Map(x => x.Password);
Map(x => x.FirstName);
Map(x => x.LastName);
Map(x => x.Phone);
Map(x => x.DeletedDate);
Map(x => x.Enabled);
}
}
Here is how I'm creating my Session Factory
var dbconfig = MySQLConfiguration
.Standard
.ShowSql()
.ConnectionString(a => a.FromAppSetting("MySqlConnStr"));
FluentConfiguration config = Fluently.Configure()
.Database(dbconfig)
.Mappings(m =>
{
var mapping = m.FluentMappings.AddFromAssemblyOf<TransactionDetail>();
mapping.ExportTo(mappingdir);
});
and this is my NHibernate code:
using (var trans = Session.BeginTransaction())
{
var user = GetById(userId);
user.Enabled = false;
user.DeletedDate = DateTime.Now;
user.UserName = "deleted_" + user.UserName;
user.Password = "--removed--";
Session.Update(user);
trans.Commit();
}
No exceptions are being thrown. No queries are being logged. Nothing.
as title said, Im trying to change only the first occurrence of word.By using
sed 's/this/that/' file.txt
though i'm not using g option it replace entire file. How to fix this.?
UPDATE:
$ cat file.txt
first line
this
this
this
this
$ sed -e '1s/this/that/;t' file.txt
first line
this // ------> I want to change only this "this" to "that" :)
this
this
this
I'm trying to create a WCHAR:
LONG bufferSize = foo.bar() + 1;
WCHAR wszBaz[bufferSize];
The compiler issues an error:
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
error C2133: 'wszBaz' unknown size
What am I doing wrong?
UPDATE: I added const but it still gives the same error:
const LONG bufferSize = foo.bar() + 1;
WCHAR wszBaz[bufferSize];
Forget screenshots, is it posible to capture a video of the running application in android?
Rooted or non-rooted, I don't care, I want atleast 15fps.
Update: I don't want any external hardware. The intent is to make it perfectly portable and every frame is captured within Android OS. If it crosses the boundaries of the app sdk, I'm willing to go to OS level modifications but I would need a starting point.
Would it be quicker to make wordpress theme direct on FTP? bcoz client want to see the progress and if i will work on local XAMPP then it would not be possible to update any changes quickly.
How to setup theme development environment with any free and lightweight IDE?
I am developing a small application usng JSF 1.1, Ajax4jsf and Tiles. When I click the a4j:commandLink, the entire page is reloaded. I want to update only portion of the page. How to resolve that?
I have an iframe and I wrote this code
window.parent.document.getElementById('parentPrice').innerHTML
to access parent element. How to get the same result using jquery?
UPDATE: Or how to access iFrame parent page using jquery?
NHibernate_reference.pdf, page 26:
Note that ILifecycle.OnUpdate() is not called every time the object's persistent state is updated. It is called only when a
transient object is passed to ISession.Update().
Why it design link that?
For example I have long list of buttons: <input type=button name=clickbutton onclick='dosomething(this)'>
But instead of putting call to the same funcion in every button it would be more rational to add a single listening event that would wait for click of that button with this name. But again, there are maany this buttons so I need pass clicked object to a function. For example this function must update a textarea field that is adjacent (nextSibling) to this button.
In C# 4.0 and IronPython 2.6, is it possible to execute a python script in it's own thread?
I would like to spawn off the script after passing in some event handler objects so that it can update the GUI as it runs.
In my entities, I tend to add comments for the properties but as I update the model and save it, all the comments are removed.
How can I stop this behavior?
I have a column that contains links. The problem is that the titles of the links are in the same column, so it looks like this:
linktitle|-|linkurl
I want link title and linkurl in separate columns.
I've created a new column for the urls, so I'm looking for a way to extract them and update the linkurl column with them. Is there any clever way to construct a query that does this?
I've implemented a service that does an asynchronous sync to between my application and google docs. I want to update the top level activity of my application when the sync is complete. However because of the service it's possible that the app could be be in a unknown state. Is there a way to make the top level activity, whatever that may be, recreate itself from an asynchtask in a service.
I've developed a website in php codeigniter with the idea of using single physical instance of the code.
Here the logic i wanted to be is on login page user will chose the companyid which will be internally to the database name.
I want to know how to update the active_group variable according to the company id chosen by the user at the time of login.
Is there any way to do so.
I have a DB schema composed of MYISAM tables, i am interested to delete old records from time to time from some of the tables.
I know that delete does not reclaim the memory space, but as i found in a description of DELETE command, inserts may reuse the space deleted
In MyISAM tables, deleted rows are maintained in a linked list and subsequent INSERT operations reuse old row positions.
I am interested if LOAD DATA command also reuses the deleted space?
UPDATE
I am also interested how the index space reclaimed?