DataSet.Tables("TableName").Rows(1)(2)
Where Rows(Zero Based Row Number Index)(Zero Based Column Index)
Or Rows(1)("ColumnNameAsString")
Hope this helps.
Justin
"N. Okan Guney" <gu******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello,
How could I read just one cell out of a dataset?
I have a query returing a 3 x 3 table.
a b c
d e f
x y z
I need the value of "f" ([2][2] ) from the table. How could I do this
using C#?
Thanks in advance,
System.Data.DataSet onhand(string partno) {
string connectionString = "server=\'sql01\'; trusted_connection=true;
database=\'data03\'";
System.Data.IDbConnection dbConnection = new
System.Data.SqlClient.SqlConnection(connectionStri ng);
string queryString = "SELECT [inmast].[fonhand] FROM [inmast] WHERE
(([inmast].[fpartno] = \'"+partno+"\') AND" + " ([inmast].[fcstscode] =
\'A\'))";
System.Data.IDbCommand dbCommand = new System.Data.SqlClient.SqlCommand();
dbCommand.CommandText = queryString; dbCommand.Connection = dbConnection;
System.Data.IDbDataAdapter dataAdapter = new
System.Data.SqlClient.SqlDataAdapter();
dataAdapter.SelectCommand = dbCommand; System.Data.DataSet dataSet = new
System.Data.DataSet();
dataAdapter.Fill(dataSet);
return dataSet;
}