Hi There,
I Need help with this
I have this code that populates a DataGrid in .Net 3.5 Win Forms works fine,
i need to add an if statment that if cmd returns >1 records Then windows2.show.
The idea is the if query returns more than 1 record a popup asks you wich one do you want to show, than you click the one you need and the datagrid populates with that record..
Code:
Dim cmd As SqlCommand = cnn.CreateCommand
cmd.CommandType = CommandType.Text
cmd.CommandText = "SELECT SLP05.CNAM05, SLP05.CUSN05, SLP05.CAD205, SimDefault.SimNet, SimDefault.Cost, SimDefault.Commission FROM SimDefault CROSS JOIN SLP05 Where (SLP05.CNAM05 Like '" & txtName.Text & "%')"Dim da As SqlDataAdapter = New SqlDataAdapter
da.SelectCommand = cmd
Dim ds As DataSet = New DataSet
da.Fill(ds, "CNAM05")
DataGridViewSearch.DataSource = ds
DataGridViewSearch.DataMember = "CNAM05"