Click here to Skip to main content
15,890,043 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all

below is the code i wrote to bind the grid from database

VB
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
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900