locked
JScript.net DataRelations RRS feed

  • Question

  • User-1276426696 posted
    <color="#6633cc">Edited by SomeNewKid. Please post code between </color><color="#000000"><</color>code><color="#6633cc"> and </color><color="#000000"><</color>/code><color="#6633cc"> tags.</color>
    Hi, If I use the following in an aspx page from a custDS dataset queried from Northwind, I get a 'Specified cast is not valid' error at the GetChildRows line. Cannot get it to work! First for...in works fine on its own. VB equivalent works fine. Anyone any ideas? Thanks, Tim var custOrderRel : DataRelation = custDS.Relations.Add("CustOrders", custDS.Tables["Customers"].Columns["CustomerID"], custDS.Tables["Orders"].Columns["CustomerID"]); var custRow : DataRow; var orderRow : DataRow; for(custRow in custDS.Tables["Customers"].Rows){ Response.Write(custRow["CustomerID"]); for(orderRow in custRow.GetChildRows(custOrderRel)){ Response.Write(orderRow["OrderID"]); } }
    Monday, February 7, 2005 2:47 AM

All replies

  • User-1232150069 posted
    Is there a line associated with the error?
    Tuesday, March 8, 2005 1:39 PM