Hi,
I am using Database connections to create lots of datasets in a project that I am currently working on. I have found one problem with one of my datasets which hasnt occured for the others though:
I get "OleDbException was Unhandled - No value given for one or more required parameters." at the red line.
The only difference in this initial setup from the others I have created is that this time round I am not specifying a WHERE clause in the SQL statement.
Can anyone see where the exception is arising from?
Thanks for the help!
I am using Database connections to create lots of datasets in a project that I am currently working on. I have found one problem with one of my datasets which hasnt occured for the others though:
VB.NET:
[SIZE="2"]' Set database connection
pupilNameConnect.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = F:\Software engineering project\SchoolTestProgram\SchoolTestDatabase.mdb"
' Open database connection
pupilNameConnect.Open()
' Set the sql string
pupilNameSql = "SELECT PupilDetails.[FirstName], PupilDetails.[Surame] FROM PupilDetails"
' Initialise data adapter
pupilNameDa = New OleDb.OleDbDataAdapter(pupilNameSql, pupilNameConnect)
' Fill dataset with pupil information
[COLOR="Red"]pupilNameDa.Fill(pupilNameDs, "PupilNames")[/COLOR]
' Instantiate noOfPupils
noOfPupils = pupilNameDs.Tables("PupilNames").Rows.Count
' Add each pupil in the databases' name to the combo box
For i = 0 To noOfPupils - 1
cboSelectPupil.Items.Add(pupilNameDs.Tables("currentPupil").Rows(i).Item("FirstName").ToString + " " + pupilNameDs.Tables("currentPupil").Rows(i).Item("Surame").ToString)
Next[/SIZE]
I get "OleDbException was Unhandled - No value given for one or more required parameters." at the red line.
The only difference in this initial setup from the others I have created is that this time round I am not specifying a WHERE clause in the SQL statement.
Can anyone see where the exception is arising from?
Thanks for the help!