Hi...I am writing this function in C# as below...but when building I get an error message stating
"Error 3 'System.Data.DataSet' does not contain a definition for 'Table' "
the code is as below....
public DataTable getMultipleData(string query)
{
OleDbConnection Connection = CreateConnection();
OleDbDataAdapter dataAdapter = new OleDbDataAdapter(query, Connection);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);
// Close the connection
Connection.Close();
dataAdapter.Dispose();
return ds.Tables(0);
}
so where is it not working????
Returing a DataTable
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Carl Schrader34 reputationPosted Mar 28, 2009, 11:54 PM EDT
Sayed,
Your I believe your problem is the curved brackets ( "(" and ")" ).... I think you need to use square brackets .....
So replace:
return ds.Tables(0);
With :
return ds.Tables[0];
Carl
Sayed Faiz7 reputationPosted Mar 28, 2009, 11:57 PM EDT