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
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