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????
Loading
Sayed FaizPosted Mar 29, 2009, 3:57 AM
Carl SchraderPosted Mar 29, 2009, 3:54 AM
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