Hi all
below is the code i wrote to bind the grid from database
Dim commd As New SqlCommand("select i.ItemName, o.MeasureType,o.Cut,o.Sets,o.Ouantity,o.TMeters,o.Rate,o.Bales,o.Remark from OrderDetails as o inner join ItemInfo as i on i.IIID=o.IIIDItemRef inner join OrderMaster as m on m.OMID=o.OMIDFormRef where m.OrderFormNo='" & cmbOrderNo.SelectedValue.ToString & "'", con)
con.Open()
Dim data As New DataTable
Dim dadap As New SqlDataAdapter(commd)
dadap.Fill(data)
If data.Rows(0)("Sets").ToString = "0" Then
DGOrderGeneral.ItemsSource = data.DefaultView
Else
DGOrderGeneral.Columns(4).Visibility = Windows.Visibility.Visible
DGOrderGeneral.Columns(5).Visibility = Windows.Visibility.Hidden
Dim commd1 As New SqlCommand("select i.ItemName, o.MeasureType,o.Cut,o.Sets,o.Ouantity,o.TMeters,o.Rate,o.Bales,o.Remark from OrderDetails as o inner join ItemInfo as i on i.IIID=o.IIIDItemRef inner join OrderMaster as m on m.OMID=o.OMIDFormRef where m.OrderFormNo='" & cmbOrderNo.SelectedValue.ToString & "'", con)
con.Close()
con.Open()
Dim data1 As New DataTable
Dim dadap1 As New SqlDataAdapter(commd1)
dadap1.Fill(data1)
DGOrderGeneral.ItemsSource = data1.DefaultView
End If
But the problem is when ever i run this code it's throughing error
ambiguousmatchexception was unhandled
it's not showing also where is the problem.but if i comment this part, then it's running properly..
Please need help from your side..
Thank you