I am trying to select data from 2 access tables using a single command object. here is my code-
using (OleDbCommand cmdCommand=new OleDbCommand())
{
cmdCommand.CommandType = CommandType.Text;
cmdCommand.CommandText = "select * from tableA;select * from tableB";
cmdCommand.Connection = Connection;
using (OleDbDataAdapter daData=new OleDbDataAdapter())
{
daData.SelectCommand = cmdCommand;
Connection.Open(); daData.Fill(ds); Connection.Close();
}
}
But it throws exception "Characters found after end of sql statement." Any suggesstion?