Subject | Re: C# INSERT not going thru |
---|---|
Author | jamesdu71 |
Post date | 2003-08-06T22:03:06Z |
Thank you for your reply Sandeep, I've added this
myFbCommand.ExecuteNonQuery();
myTxn.Commit();
myConn.Close();
No errors but no Insert either??
hmmm..?
Thanks alot;
--- In firebird-support@yahoogroups.com, Sandeep Chandra
<sandeep@c...> wrote:
myFbCommand.ExecuteNonQuery();
myTxn.Commit();
myConn.Close();
No errors but no Insert either??
hmmm..?
Thanks alot;
--- In firebird-support@yahoogroups.com, Sandeep Chandra
<sandeep@c...> wrote:
> James Dunkley wrote:but then checking database from console verifies nothing has happened.
>
> >Hello;
> >
> >this code below runs without error, it looks like it does Insert
> >= "Database=DATA.FDB;User=me;Password=pass;Dialect=3;Server=host";
> >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
> >('luutf', 'uytd')";
> >}
> >
> >
> >
> >FbConnection myConn = new FbConnection(myConnectionString);
> >
> >
> >
> >myConn.Open();
> >
> >
> >
> >
> >
> >FbTransaction myTxn = myConn.BeginTransaction();
> >
> >string myInsertQuery = "INSERT INTO INFO(name, phone) Values
> >myTxn);
> >FbCommand myFbCommand = new FbCommand(myInsertQuery, myConn,
> >
> >
> >
> >myFbCommand.ExecuteNonQuery();
> >
> >myConn.Close();
> >
> >}
> >
> >
> I think you are missing myTxn.Commit ();
>
> Regards
>
> Sandeep