2
Reply

returing a DataTable

Sayed Faiz

Sayed Faiz

Mar 28 2009 9:19 PM
2.7k
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????

Answers (2)