how can we display records in single datagrid using two
datasets in different place?
Answers were Sorted based on User's Feedback
Answer / ruby
we can do it using merge method of dataset.
but for that bot the tables must have same no. of columns , same fields and their respective datatypes.
also both the data table's name must be same("Table1" of both the datasets)
Sub BindGrid()
Dim myConnection as New SqlConnection (strConn)
Dim DS1 As DataSet
Dim DS1 As DataSet
Dim MyCommand As SqlDataAdapter
MyCommand = new SqlDataAdapter("exec s_get_table1", MyConnection)
DS1 = new DataSet()
MyCommand.Fill(DS1, "Table1")
MyCommand = new SqlDataAdapter("exec s_get_table2", MyConnection)
DS2 = new DataSet()
MyCommand.Fill(DS2, "Table1")
// Then using MERGE function of dataset we can merge both the datasets like
ds1.merge(ds2)
//binding with grid
MyDataGrid.DataSource=DS1.tables(0).DefaultView
MyDataGrid.DataBind()
End Sub
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / nitin jadav
OracleConnection cn = new OracleConnection("user
id=scott;password=tiger;data source=ganesh1");
OracleDataAdapter da1 = new
OracleDataAdapter("select * from table1", cn);
DataSet ds = new DataSet();
da1.Fill(ds, "temp");
OracleDataAdapter da2 = new
OracleDataAdapter("select * from table2", cn);
DataSet ds1 = new DataSet();
da2.Fill(ds1, "temp");
ds.Merge(ds1);
dataGridView1.DataSource = ds.Tables[0].DefaultView;
label1.Text = ds.Tables[0].Rows.Count.ToString();
Is This Answer Correct ? | 0 Yes | 0 No |
explain about Back ground process control in .net
1 Answers Digital Mesh, Infronics,
what is Versioning in asp.net and how it maintain in any web application
What is CLS?
5 Answers IBM, PrimeLine, TCS,
what are the Custom controls in asp.net?
What is custom control. What is the difference between custom control and user control?
How we can bind textbox,listbox and datagrid to sql server database in asp.net using visualstudio.net language (vb.net)?
What is WebService ?
8 Answers Tanla Solutions, Yahoo,
Give some salient points of difference between request processor and request dispatcher.
What is client side state management?
In early binding will the method invoked on com component will verify it?s existance in the system or not ?
What is css and what is it used for?
On what object is the transaction in ADO.NET focused on? a) The command object b) The DataSet object c) The Connection object d) The DataAdapter object