I've got part of my code started to populate the DataGridView with the data I need to return. When testing it, I have this long pause and no returned data. I finally have to kill it via <Control><Alt><Delete>. I've tried reading through mulitple websites to find some information to connect and fill the table, but I don't think I'm understanding it correctly. Hopefully you can help.
What I ultimately want to to:
1) Search the database for part numbers that begin with "AO" (my test database has two examples in it)
2) Return these two examples to the grid.
Dim connstr = "Data Source=Don-PC;Provider=SQLOLEDB;Initial Catalog=DataDesignSolutions;Integrated Security = True;User ID=DON-PC;Password=be67011" Dim search1 As String = "'%" & string1 & "%'" Dim sqlquery = "SELECT [INV-PART-NUMBER], [INV-DESCRIPTION] FROM INVENTORY where [INV-PART-NUMBER] like " & search1 Dim connection As SqlConnection = New SqlConnection(connstr) connection.Open() Dim command As SqlCommand = connection.CreateCommand() command.CommandText = sqlquery Dim reader As SqlDataReader = command.ExecuteReader() reader.Read() Me.DataDesignSolutionsDataSet1BindingSource.DataSource = DataDesignSolutionsDataSet1 connection.Close()
Hopefully you'll see what I'm missing (or have wrong) and help me fix it.
I remind you, I'm a newbie programmer. This is my first attempt to using the DataGridView.