TheWizardofInt Posted September 11, 2002 Posted September 11, 2002 I used the stock code to open my SQL table and return the dataset "User" where a Username and Password match what is entered on a login screen Using a SQL query I return a dataset from the function. I now want to know if the dataset is empty or not. Anyone know how to actually READ the field values in ADO.net? I am going nuts with this Thanks Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
*Gurus* Thinker Posted September 11, 2002 *Gurus* Posted September 11, 2002 Are you using a DataAdapter? If so, you should check the return value from the Fill method when you use it to populate your dataset. Once you have used Fill, a new Table object will have been added to the DataSet Tables collection. The Table object has both a Rows and a Columns collection. As each Row object is selected, the Columns objects have the values for that Row. This is all just theory to me that I got from MSDN and an ADO.Net reference. However, it makes sense to me, and I expect it works pretty much as described. Quote Posting Guidelines
*Gurus* Derek Stone Posted September 11, 2002 *Gurus* Posted September 11, 2002 In a case like this where no data is ever displayed (as far as I know) I'd suggest using a DataReader object instead, the .Read method returning False if no data has been returned. Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.