|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Successfully executing queriesHi
I need to run separate insert & update queries. I suppose I can use execute.nonquery to execute the queries. How can I tell if the queries were successful? Thanks Regards The simplest way is to check the return value of that method, and see the
number of rows affected. Alternatively, you could add some exception throwing stuff in your SQL commands. - Sahil Malik [MVP] ADO.NET 2.0 book - http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx __________________________________________________________ Show quote "John" <John@nospam.infovis.co.uk> wrote in message news:uqS5wbcYGHA.3704@TK2MSFTNGP03.phx.gbl... > Hi > > I need to run separate insert & update queries. I suppose I can use > execute.nonquery to execute the queries. How can I tell if the queries > were successful? > > Thanks > > Regards > John,
Be aware that if you do use the executenonquery to update, than you have not the inbuild concurency checking from the dataadapter. (checking if the old is not already changed). Just as little warning, Cor Show quote "John" <John@nospam.infovis.co.uk> schreef in bericht news:uqS5wbcYGHA.3704@TK2MSFTNGP03.phx.gbl... > Hi > > I need to run separate insert & update queries. I suppose I can use > execute.nonquery to execute the queries. How can I tell if the queries > were successful? > > Thanks > > Regards > |
|||||||||||||||||||||||