Mark
Mark

Reputation: 2760

how to add two data set to a grid view table

ds = server.ExecuteQuery(CommandType.Text, MysqlStatement, param);
ds1 = server.ExecuteQuery(CommandType.Text, getOwnMsgQuery, param);
Grid_Messagetable.DataSource =ds;
Grid_Messagetable.DataSource = ds1;

I have to do two different query to get data for a grid table, but in this case it is showing only result from ds1 as it is executed after ds. How can I do this. Thanks

Upvotes: 0

Views: 380

Answers (1)

Icarus
Icarus

Reputation: 63970

If both datasets have largely the same schema, you could merge them before binding to the grid:

ds.Merge(ds1);
Grid_Messagetable.DataSource = ds;

See here.

Upvotes: 1

Related Questions