1
Answer

Bind DataRelation to DataList

jarabud

jarabud

20y
2.4k
1
How do I bind datarelation to either datalist or datagrid control here what I understanded so far. SqlConnection nwindConn = new SqlConnection("Data Source=localhost;" + "Integrated Security=SSPI;Initial Catalog=Northwind;"); SqlDataAdapter custDA = new SqlDataAdapter("SELECT CustomerID, CompanyName FROM Customers", nwindConn); SqlDataAdapter orderDA = new SqlDataAdapter("SELECT OrderID, CustomerID, OrderDate FROM Orders", nwindConn); nwindConn.Open(); DataSet custDS = new DataSet("CustomerOrders"); custDA.Fill(custDS, "Customers"); orderDA.Fill(custDS, "Orders"); nwindConn.Close(); DataRelation custOrderRel = custDS.Relations.Add("CustOrders", custDS.Tables["Customers"].Columns["CustomerID"], custDS.Tables["Orders"].Columns["CustomerID"]); Thanks, Regards Jarabud
Answers (1)
0
sacresp

sacresp

NA 458 0 20y
In your C# project, add to a reference to the compiled vb.net assembly. Or, if you're using VS.NET, you can add reference to the other project (both must be loaded in the same solution)