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

You are not passing in a proper value to the SQL: SELECT Title, Description FROM Incidents WHERE (CustomerID = textbox1. Text) It will try to look for CustomerID that is equal to the database value "textbox1. Text".

Since this is probably the wrong data type and a table/column that doesn't exist, you are getting the error You should be using a parameterized query to avoid SQL Injection Dim sql As String = "SELECT Title, Description FROM Incidents WHERE (CustomerID =? )" Dim myCommand As New System.Data.OleDb. OleDbCommand(sql, conn) myCommand.Parameters.

Add("@p1", OleDbType. Integer, 4). Value = textbox1.

Text This will fail if the value in textbox1. Text is not of the right type - you should both validate and convert to the right type (my code assumes an integer).

You are not passing in a proper value to the SQL: "SELECT Title, Description FROM Incidents WHERE (CustomerID = textbox1. Text)" It will try to look for CustomerID that is equal to the database value "textbox1. Text".

Since this is probably the wrong data type and a table/column that doesn't exist, you are getting the error. You should be using a parameterized query to avoid SQL Injection. Dim sql As String = "SELECT Title, Description FROM Incidents WHERE (CustomerID =?)" Dim myCommand As New System.Data.OleDb.

OleDbCommand(sql, conn) myCommand.Parameters. Add("@p1", OleDbType. Integer, 4).

Value = textbox1. Text This will fail if the value in textbox1. Text is not of the right type - you should both validate and convert to the right type (my code assumes an integer).

I have had little to no luck finding this information online. – allencoded yesterday @allencoded - Answer amended, example added. I suggest reading the MSDN documentation for the OleDB classes.

– Oded yesterday.

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.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions