Subject | Re: [firebird-support] C# INSERT not going thru |
---|---|
Author | Sandeep Chandra |
Post date | 2003-08-06T21:42:43Z |
James Dunkley wrote:
Regards
Sandeep
>Hello;I think you are missing myTxn.Commit ();
>
>this code below runs without error, it looks like it does Insert but then checking database from console verifies nothing has happened.
>
>Sorry I'm new,
>
>thank all of you in advance!
>
>
>
>
>
>
>
>public void InsertRow(string myConnectionString)
>
>{
>
>// If the connection string is null, use a default.
>
>if(myConnectionString == "")
>
>{
>
>myConnectionString = "Database=DATA.FDB;User=me;Password=pass;Dialect=3;Server=host";
>
>}
>
>
>
>FbConnection myConn = new FbConnection(myConnectionString);
>
>
>
>myConn.Open();
>
>
>
>
>
>FbTransaction myTxn = myConn.BeginTransaction();
>
>string myInsertQuery = "INSERT INTO INFO(name, phone) Values ('luutf', 'uytd')";
>
>FbCommand myFbCommand = new FbCommand(myInsertQuery, myConn, myTxn);
>
>
>
>myFbCommand.ExecuteNonQuery();
>
>myConn.Close();
>
>}
>
>
Regards
Sandeep