Q
Quarantine
I am still a noob at the whole .NET, but I have a question and hope
someone can help me out. I am taking user input, then want to query
a database and return the results to either a datagrid, or a
dynamically created table. I want to be able to pass a variable to
the SQL command that I have created, but I don't know how to get the
format right. Here is a snippet of my code I know that the format
of my SQL command is totally wrong after the WHERE portion. If
anybody could help me, I would appreciate it a lot!
Dim conn As OleDbConnection
Dim texthold as String
conn = New OleDbConnection
txtUserInput.text = Cstr(texthold)
conn.ConnectionString = _
System.Configuration.ConfigurationSettings.AppSettings.Get _
("ConnectionString")
conn.Open()
Dim querydb As New OleDbCommand("SELECT * FROM tapeinfo
WHERE LIKE texthold", conn)
Dim results As OleDbDataReader
Dim i As Integer
results = querydb.ExecuteReader(CommandBehavior.CloseConnection)
Bryant
someone can help me out. I am taking user input, then want to query
a database and return the results to either a datagrid, or a
dynamically created table. I want to be able to pass a variable to
the SQL command that I have created, but I don't know how to get the
format right. Here is a snippet of my code I know that the format
of my SQL command is totally wrong after the WHERE portion. If
anybody could help me, I would appreciate it a lot!
Dim conn As OleDbConnection
Dim texthold as String
conn = New OleDbConnection
txtUserInput.text = Cstr(texthold)
conn.ConnectionString = _
System.Configuration.ConfigurationSettings.AppSettings.Get _
("ConnectionString")
conn.Open()
Dim querydb As New OleDbCommand("SELECT * FROM tapeinfo
WHERE LIKE texthold", conn)
Dim results As OleDbDataReader
Dim i As Integer
results = querydb.ExecuteReader(CommandBehavior.CloseConnection)
Bryant