Private Sub butsea_Click(sender As Object, e As EventArgs) Handles butsea.Click Dim dset As New DataSet Dim da As SqlDataAdapter Dim myCmd As New SqlCommand Try myConn.ConnectionString = "Data Source=THEONE\PARTH;Initial Catalog=testdatabase;Integrated Security=True;" myConn.Open() Dim avalue As String = (InputBox("Input Student Id", "Search Student")).ToString txt_id.Text = avalue da = New SqlDataAdapter("SELECT * FROM studentdetails where student_id= '" & txt_id.Text & "", myConn) If dset.Tables(0).Rows.Count > 0 Then 'what should i write here Else MsgBox("No Record Found") End If Catch ex As Exception MsgBox(ex.Message) Finally myConn.Close() End Try End Sub
If dset.Tables(0).Rows.Count > 0 Then txt_name.Text = dset.Tables(0).Rows(0)("name").ToString() Else MsgBox("No Record Found") End If
*
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)