Exception Details: System.Data.OleDb.OleDbException: No value give

G

Guest

Hello,

I'm trying to fill a datagrid using a dataset. I keep getting the following
error:

Exception Details: System.Data.OleDb.OleDbException: No value given for one
or more required parameters

The following is the code i'm using: Any suggestions would be greatly
apprpciated.


Sub BindGrid()

Dim MyCommand

Dim strConnectionString as String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
"C:\Inetpub\wwwroot\StatusReport\StatusReport.mdb;"

Dim myConnection as New OleDbConnection(strConnectionString)

myConnection.Open()

Dim strSQL as String = "SELECT SeqNo, DataAssigned, Task, Outcome,
DueDate, Complete, CompleteData, AssignBy FROM StatusReport ORDER BY SeqNo"

MyCommand = New OleDBCommand (strSQL, myConnection)

Dim myDataAdapter = New OleDbDataAdapter(strSQL, myConnection)

Dim myDataSet as DataSet = new DataSet()

myDataAdapter.Fill(myDataSet, "StatusReport")

MyDataGrid.DataSource = myDataSet.Tables("StatusReport")
MyDataGrid.DataBind()

End Sub
 
M

Miha Markic [MVP C#]

Hi Bill,

If I have to guess then I would say that at least one column is mispelled.
Does the same select command work from within access?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top