jarabud

jarabud

  • NA
  • 4
  • 0

Bind DataRelation to DataList Control

Dec 11 2004 6:51 PM
How do I bind datarelation to either datalist control control? here is 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