Trying to output Data in Visual Web Developer 2008 from ACCESS Database using VB

joanraw

New Member
Ok I can successfully connect to my Access database but I am still learning on how to output that data. Here is the run down.I am designing a page where the user inputs the customer ID and then gets a list of incidents for that customer. Then I would like the user to be able to add a survey about the incident.Problem I am running into is the ability to display this data. I have tried various method. Eventually I want to be able to display the data into a listbox and have them select it and take the survey but I am not near that far yet. Here is what I have on the connection and my attempt which doesn't work to output the data:\[code\]Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim sql As String = "SELECT [Title], [Description] FROM [Incidents] WHERE ([CustomerID] = textbox1.text)" Dim conn As New System.Data.OleDb.OleDbConnection() conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "C:\Users\Allen PC7\Documents\Visual Studio 2008\Projects\1-A SportsPro\App_Data\TechSupport.mdb" Dim myCommand As New System.Data.OleDb.OleDbCommand(sql, conn) conn.Open() Dim myReader As System.Data.OleDb.OleDbDataReader = myCommand.ExecuteReader() Try While myReader.Read() Console.WriteLine(myReader.GetInt32(0).ToString() + ", " + myReader.GetString(1)) End While Finally myReader.Close() conn.Close() End Try End Sub\[/code\]I just can't get anything displayed in the console and instead get an error saying Dim myReader As System.Data.OleDb.OleDbDataReader = myCommand.ExecuteReader()...System.Data.OleDb.OleDbException: No value given for one or more required parameters.Thanks
 
Top