I am trying to access data in SQL Server and pull it into the form. I am somewhat new at this. Can anyone help me out? I have one form open and you type in the case number. or lastname. Then I want it to be able to pull in data into another form. PLEASE HELP! This is what I have so far:
VB Code:
SqlConn.Open() Dim drSqlDataReader1 As SqlDataReader = cmdSqlCommand1.ExecuteReader() drSqlDataReader1.Read() Dim search As String If IsNumeric(txtSearchCase.Text) Then search = "SELECT * FROM CapRec WHERE CaseNumber LIKE '%" & txtSearchCase.Text & "%';" 'txtCaseNum.Text = drSqlDataReader1.Item(0) Else search = "SELECT * FROM CapRec WHERE LastName LIKE '%" & txtSearchCase.Text & "%';" End If




Reply With Quote