Subject Re: C# INSERT not going thru
Author jamesdu71
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:
> James Dunkley wrote:
>
> >Hello;
> >
> >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();
> >
> >}
> >
> >
> I think you are missing myTxn.Commit ();
>
> Regards
>
> Sandeep