Shaitan00 Posted February 12, 2005 Posted February 12, 2005 Given a Dataset [oRecs] generated by an SQL query. I want to isolate/extrat some specific date C# CODE: oRecs = oDB.GetRecords("select [X] from This will generate a dataset [oRecs] with one row of data [only one result from the query] and one column [X]. I need to pass that value in Column [X] (as a string) to a function on the next line. So the question is, how do I isolate the value in the Dataset itself? Quote
*Experts* Nerseus Posted February 14, 2005 *Experts* Posted February 14, 2005 You'd probably be better off using a Command object's ExecuteScalar function, which is meant to be used when you have exactly one value being returned from a query. If you want to use the DataSet, try something like: string s = oRecs.Tables[0].Rows[0][0].ToString(); There are a LOT of assumptions there, but you get the idea. -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
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.