jxharding
asked on
parameter ?_3 has no default value;problems updating access 2000 database
parameter ?_3 has no default value
good day, i have a dataset with 5 datatables and 4 of them
write to 1 datatable
e.g.
Brand,Colour,Wheels,Rims,
write to CARSALE
in all of the above tables, the fields are of different
types of course, e.g. number, text, etc
i get the error:
parameter ?_3 has no default value
and i dont know where to start looking what the parameter is.
thank you
good day, i have a dataset with 5 datatables and 4 of them
write to 1 datatable
e.g.
Brand,Colour,Wheels,Rims,
write to CARSALE
in all of the above tables, the fields are of different
types of course, e.g. number, text, etc
i get the error:
parameter ?_3 has no default value
and i dont know where to start looking what the parameter is.
thank you
ASKER
Yes i am
Select the data adapter, and view the properties in the Property Window. Find the SelectCommand, and expand that set. You will find a Parameter collection under the SelectCommand.
Bob
Bob
ASKER
thanks thelearnedone
i went through all the dataadapters and could not fined one paramater in the collections
maybe thats my problem?
i went through all the dataadapters and could not fined one paramater in the collections
maybe thats my problem?
What does the SQL statement for the SelectCommand look like?
Bob
Bob
ASKER
i think i potentially found my problem
i have a table in my physical database called payment
which contains a
autoincrement field called PAYMENTID
a beneficiaryID Field (int)
and invoiceNR (string)
now i dragged this table into my dataset1.xsd
but there are other tables as well,
i did not make any relationships, although there are.
what i need to do is:
add a new entry to payment table
e.g. if last paymentID of PAYMENTTABLE was 1, the next would be 2
and then the beneficiaryID and invoiceNR would be filled in as well.
e.g.
PAYMENTID,BENEFICIARYID,IN VOICENR
2 19 ABC123
this is how i attempted it:
dim addPayment as dataset1.paymentrow = dsBeneficiary.Payment.NewP aymentRow
addpayment.benefeciaryID = 19
addpayment.invoicenr = "ABC123"
daPayment.update(dsbenefic iary,"Paym ent")
dsbeneficiary.payment.addp aymentrow( addpayment )
dsbeneficiary.acceptchange s
and now it runs through the hole code,no problem
but when i got to the database itself, nothing was written
daPayment SQL:
SELECT BeneficiaryID,InvoiceNR FROM PAYMENT
i have a table in my physical database called payment
which contains a
autoincrement field called PAYMENTID
a beneficiaryID Field (int)
and invoiceNR (string)
now i dragged this table into my dataset1.xsd
but there are other tables as well,
i did not make any relationships, although there are.
what i need to do is:
add a new entry to payment table
e.g. if last paymentID of PAYMENTTABLE was 1, the next would be 2
and then the beneficiaryID and invoiceNR would be filled in as well.
e.g.
PAYMENTID,BENEFICIARYID,IN
2 19 ABC123
this is how i attempted it:
dim addPayment as dataset1.paymentrow = dsBeneficiary.Payment.NewP
addpayment.benefeciaryID = 19
addpayment.invoicenr = "ABC123"
daPayment.update(dsbenefic
dsbeneficiary.payment.addp
dsbeneficiary.acceptchange
and now it runs through the hole code,no problem
but when i got to the database itself, nothing was written
daPayment SQL:
SELECT BeneficiaryID,InvoiceNR FROM PAYMENT
Try:
dsbeneficiary.payment.addp aymentrow( addpayment )
dsbeneficiary.acceptchange s
daPayment.update(dsbenefic iary,"Paym ent")
dsbeneficiary.payment.addp
dsbeneficiary.acceptchange
daPayment.update(dsbenefic
ASKER
thanks bob, it works!
is there any chance of u giving me a little explanation on the three lines, e.g.
line 1 has to be run before line 2 because of ...
thanks!
is there any chance of u giving me a little explanation on the three lines, e.g.
line 1 has to be run before line 2 because of ...
thanks!
ASKER
the problem i have here is that i only know now how to copy
the examples and then from there i will use it as templates
in my program . i dont know why the following 3 lines work:
dsbeneficiary.payment.addp aymentrow( addpayment )
dapayment.update(dsbenefic iary,"Paym ent")
dsbeneficiary.acceptchange s
but these 3 lines DONT work:
dsbeneficiary.payment.addp aymentrow( addpayment )
dsbeneficiary.acceptchange s
dapayment.update(dsbenefic iary,"Paym ent")
the examples and then from there i will use it as templates
in my program . i dont know why the following 3 lines work:
dsbeneficiary.payment.addp
dapayment.update(dsbenefic
dsbeneficiary.acceptchange
but these 3 lines DONT work:
dsbeneficiary.payment.addp
dsbeneficiary.acceptchange
dapayment.update(dsbenefic
I don't usually do business this way, so I have to think through this:
(1) AddRow adds a new row.
(2) AcceptChanges for the dataset calls the AcceptChanges for all rows states that are not Unchanged.
(3) Update writes the changes back to the database from the disconnected dataset
I don't think that you even need the AcceptChanges for this to work--it might even explain why it doesn't work, since you mark the row as not changed, and then try to update the database.
Bob
(1) AddRow adds a new row.
(2) AcceptChanges for the dataset calls the AcceptChanges for all rows states that are not Unchanged.
(3) Update writes the changes back to the database from the disconnected dataset
I don't think that you even need the AcceptChanges for this to work--it might even explain why it doesn't work, since you mark the row as not changed, and then try to update the database.
Bob
ASKER
thanks bob
when you mean you dont do business this way, what do you think im doing wrong?
since this is my 1st big vb.net app, id like to get it all right at the roots because i will obviously refer to following projects from this current one
when you mean you dont do business this way, what do you think im doing wrong?
since this is my 1st big vb.net app, id like to get it all right at the roots because i will obviously refer to following projects from this current one
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Bob