Send data from controls to database


New member
Nov 20, 2004
Programming Experience
:) I am having a small problem

Whenever I try to enter the Data from a textbox or listbox wiht use of parameters in data-adapter, the 'build process ' is fine but, during execution it halts to give oledb exception.

I am using an Access Database. There are no errors in the code but only during execution.

please help
Ok, i wrote a program (for a class) that used Parameterized Quiries for an Access DB.
this is what it had:

 DsCats1 as DataSet
 daCat as DataAdapter
 daCat.SelectCommand.Parameters("OwnerID").Value = lstCustomerID.Text

now what it's doing is: when the program loads, it lists all the Cat's owner names in a list box, then when the user clicks one of the names it selects only the Cat's associated with that owner (based on OwnerID) so in the Querie Builder when i made the dataset there, in the 'Criteria' column i put '=?' next to the OwnerID feild and that code up there is how to fill the dataset based on the Parameter which is what you're trying to accomplish.
thanks a lot

but i am also having another problem . Whenever I tried to enter the date(eg.Date of birth) through a textbox, it gave the exception. the datatype of the column in Access DB is set to 'DateTime'
if isdate(lstCustomerID.Text) = true then

daCat.SelectCommand.Parameters("OwnerID").Value = "#" & lstCustomerID.Text & "#"

end if

the #'s around the denote a datetime value is used in a datetime field