|
-
Jul 28th, 2004, 10:14 AM
#1
Thread Starter
New Member
DataSet Adventures
Hello all,
I am trying to master the art of using code rather than the design view form components to do this database processing. Since adding the DataAdapter using the design view requires a predefined query, that doesn't seem very realistic!
I've found an example from planet source code, and I've also found samples in the VS .NET help files. I've copied their techniques to the letter, but I cannot divine why I am getting the following error...
Error Message: "No value given for one or more required parameters"
The stack trace is pretty big, I'm not sure what I should type of it that would help to solve the problem, other than pointing out the line.
Code:
Try
Dim accessDataAdapter As OleDbDataAdapter = New OleDbDataAdapter()
accessDataAdapter.TableMappings.Add("Table", "Logins")
'**** Connect to Database ****
accessConnection.Open()
'**** ****
Dim accessSelectCommand As OleDbCommand = _
New OleDbCommand(selectString, accessConnection)
accessSelectCommand.CommandType = CommandType.Text
accessDataAdapter.SelectCommand = accessSelectCommand
Dim dsLoginSet As DataSet
dsLoginSet = New DataSet("Technicians")
' *** GENERATES EXCEPTION ***
' This is the line causing problems
' but it's just like the samples....
accessDataAdapter.Fill(dsloginSet)
' **** Catch Exception ****
Catch Ex As System.Exception
Dim errorD As DialogResult
errorD = MessageBox.Show(Ex.Message, "Error", _
MessageBoxButtons.OK, MessageBoxIcon.Stop)
errorD = MessageBox.Show(Ex.StackTrace, "Error", _
MessageBoxButtons.OK, MessageBoxIcon.Stop)
' **** Always Close Connection ****
Finally
accessConnection.Close()
End Try
' ----------------
End Sub
Anyone out there wiser than I who could help me determine the source of my problem?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|