atmosphere1212 Posted November 2, 2004 Posted November 2, 2004 If i have an sql command that is guarenteed to return a single cell (ie a count command) is it possible just to grab the integer value without using a sqlDataReader or sqlDataSet, etc... Quote
Administrators PlausiblyDamp Posted November 2, 2004 Administrators Posted November 2, 2004 You could use the ExecuteScalar method of the command object and cast the return value to an integer. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
stustarz Posted November 2, 2004 Posted November 2, 2004 If the value you want is stored in anything 'external' to your application you will need something to retrieve it, your easiest and quickest option is the datareader in this situation. Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
samsmithnz Posted November 2, 2004 Posted November 2, 2004 I agree with PlausiblyDamp, use an executescalar. I don't know how a datareader can be considered easier than this... Quote Thanks Sam http://www.samsmith.co.nz
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.