Hello,
I am using MySql as my database. I can fill individual tables, however when I query to select from 2 different tables and do an add watch on the dataset the count for those 2 tables is 0.
Everything runs without errors. However, when I check count property for the table in the add watch it gives an zero.
However, if I write the query like this: "SELECT * FROM Beverage"
and fill using this da.Fill(DS.Beverage); Then the count display the correct number of rows.
Can anyone explain this?
Many thanks,
My code for filling
Code:try { this.OpenConnection(); RestaurantDataSet ds = new RestaurantDataSet(); MySqlDataAdapter da = new MySqlDataAdapter(); MySqlCommand cmd = new MySqlCommand(); cmd.Connection = cnn; cmd.CommandType = CommandType.Text; cmd.CommandText = "SELECT maincourse.MainCourseID, beverage.BeverageID FROM maincourse, beverage"; da.SelectCommand = cmd; da.Fill(ds); return ds; } catch (Exception ex) { Console.WriteLine(ex.Message); return null; }




Reply With Quote