The simplest I know is to use ExecuteScalar. Here is a reference for
you:

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.executescalar.aspx



Regards,



Benj






On Oct 31, 10:39 pm, Davej <[email protected]> wrote:
> What is the simplest way to handle a query that you know is only going
> to return a column name and one value? I don't really want to mess
> with a dataGridView. I just want the integer. Thanks.
>
> sql = "SELECT COUNT(*) FROM ITEM_TABLE ;"

Reply via email to