How you will set the datarelation between two columns?
Answer Posted / muthu kumar
DataSet d = new DataSet();
DataColumn parentDC = new
DataColumn(d.Tables["parentTable"].Columns["id"]);
DataColumn childDC = new
DataColumn(d.Tables["ChildTable"].Columns["id"]);
DataRelation ds = new DataRelation("relation name",
parentDC, childDC);
d.Relations.Add(ds);
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Which is faster sqldataadapter and sqldatareader?
Why is it important to close an ado.net application?
What are the advantages of oledb compared with other classes?
What is a control toolbox?
What are typed and untyped dataset?
How to copy the contents from one table to another table and how to delete the source table in ado.net?
What are the disadvantages of using datalist?
Can we connect two dataadapters to same data source using single connection at same time?
differance between ADO vs ADO.Net?
Explain the advantages and disadvantages of using datalist?
How is it possible to get 2 tables of data at a time by using data reader?
What is ado.net components?
What is execute reader in ado.net?
What is the difference between data grid and data repeater?
Explain the role of data provider in ado.net?