Hello! I have been using ExecuteNonQuery() to update a few rows here and there no problem. Now I want to update 50,000+ rows and nothing happens...

So I want to update the value of field rxLabelID to the value in field silviculture, both integers. Works fine the access quiery gui. No luck if I swap silviculture out for a number, i.e., -1.

sql = " UPDATE fps_HarvSchdsRawRxs SET rxLabelID = silviculture;";
theCmd = new OleDbCommand(sql, theConn);
x = theCmd.ExecuteNonQuery();

The correct # of rows are returned via x.

And a similar query to a different table, with only one row, works fine.

A third query, for deleteing about a dozen records works, but takes over a minute to execute.

Thanks in advance for your input!

7 Years
Discussion Span
Last Post by finito

x = theCmd.ExecuteNonQuery();

this will not return anything. and should give an error.

what is x defined as? int?

you need to do

x = int.Parse(new OleDbCommand("Your Select Statement with Count()",theConn).ExecuteScaler().toString())

You may wish to get rid of the semicolon in your update string.

Edited by finito: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.