G
Guest
I am writing a VB program, and on one particular form, I want to update a database based on a calculation, and the user inputting a number in a combo box on a form. In my table, the field names are name, 1-17, and total.
Here is a sample of the parameter definitions
Dim prm4 As OleDb.OleDbParameter = _
dap2.UpdateCommand.Parameters.Add("@name", _
System.Data.OleDb.OleDbType.VarChar, 25, "name")
Dim prm5 As OleDb.OleDbParameter = _
dap2.UpdateCommand.Parameters.Add("@1", _
System.Data.OleDb.OleDbType.Integer, "1")
all the way to 17, and total.
1st question: When I run the program, the user enters 1 in the combo box, I receive:
Parameter ?_2 has no defaut value.
I want the program to leave the value in field 2 in the database alone.
2nd question:
I dont want to write 17 sets of code for the 17 options a user can choose. I want to write a statement something like:
drw2("1") = xx
but I want the 1 to be cboChoice.Text, but I do not know how to format the command.
Please help.
Here is a sample of the parameter definitions
Dim prm4 As OleDb.OleDbParameter = _
dap2.UpdateCommand.Parameters.Add("@name", _
System.Data.OleDb.OleDbType.VarChar, 25, "name")
Dim prm5 As OleDb.OleDbParameter = _
dap2.UpdateCommand.Parameters.Add("@1", _
System.Data.OleDb.OleDbType.Integer, "1")
all the way to 17, and total.
1st question: When I run the program, the user enters 1 in the combo box, I receive:
Parameter ?_2 has no defaut value.
I want the program to leave the value in field 2 in the database alone.
2nd question:
I dont want to write 17 sets of code for the 17 options a user can choose. I want to write a statement something like:
drw2("1") = xx
but I want the 1 to be cboChoice.Text, but I do not know how to format the command.
Please help.