Click here to Skip to main content
15,897,273 members

Display Records in Datta Grid view against selection of combo box vale.

Revision 4
I am trying to Fetch record from Sql & display it in Data Grid View against the selection of Combo Box value.I am using Vb.net & Sql Server '05.

I am using Following code:

Public Function GetView(ByVal strQuery As String) As DataSet
Dim ds As New DataSet
Dim da As New SqlDataAdapter(strQuery, SetCon())
da.Fill(ds, "New")
Return ds
End Function

Dim dsvalue As DataSet
dsvalue = obj.GetView("Select p.PO_no,p.Date,s.Name from PO_Header p, SupplierMaster s Where p.Sup_no = " & cmbSupplierName.SelectedValue & ";" )
DataGridView1.DataSource = dsvalue.Tables(0).DefaultView


System show me Error :Operator '&' is not defined for string "Select p.PO_no,p.Date,s.Sup_name" and type 'DataRowView'.
Posted 5-Sep-12 4:07am by Yogi ,Pune.
Tags: , ,