HI there,
I am trying to join two datatables using LINQ.
When I debug this, I get the error, System.InvalidC astException: Specified cast is not valid.
I get this error in the line, joinquery =...
I also have used Integer as the field type for the column, CLASS_NO.
can someone help me with this.
I also tried using datarelation to join the two data tables, but could not figure how I can dispaly both parent table and child table in a single data gridview.
thank you
I am trying to join two datatables using LINQ.
Code:
Dim dt1 As New DataTable
dt1.Load(dr1)
Dim dt2 As New DataTable
dt2.Load(dr2)
Dim joinquery = From t1 In dt1.AsEnumerable(), t2 In dt2.AsEnumerable() _
Where (t1.Field(Of Long)("CLASS_N0") = _
t2.Field(Of Long)("CLASS_N0")) _
Select t1, t2
NewDg.DataSource = joinquery
NewDg.DataBind()
I get this error in the line, joinquery =...
I also have used Integer as the field type for the column, CLASS_NO.
can someone help me with this.
I also tried using datarelation to join the two data tables, but could not figure how I can dispaly both parent table and child table in a single data gridview.
thank you