hello sir
i am making project on vb.net language..and project is on hospital management..its major project..and too many fields are present in its data base..i was connecting data base in forms but there is coming error..SIR PLEASE SORT OUT ERROR FROM MY COADING..what can i do to solve this error please give me sugession or if you can send me coading for adding information from form.than i will be thankfull to u..i have written all fields which has present in my database please help me..
error coming - too many parameters.
I HAVE MADE DATABASE ON MS ACCESS
SOURCE CODE -
[code=vbnet]
Dim cmd As New OleDbCommand("i nsert into table1 values(@date,@f irstname,@middl ename,@lastname ,@maritalstatus ,@sex,@feetype,
@mothersName,@f athersname,@dd, @mm,@yy,@age,@r esidentialaddre ss,@city,@state ,@country,@pinc ode,@religion,@ bloodgroup,@tel ephoneno, @mobile,@pager, @email)", con)
cmd.parameters. addwithvalue("@ date", TextBox2.Text)
cmd.Parameters. AddWithValue("@ firstname", TextBox14.Text)
cmd.Parameters. AddWithValue("@ middlename", TextBox4.Text)
cmd.Parameters. AddWithValue("@ lastname", TextBox5.Text)
cmd.Parameters. AddWithValue("@ maritalstatus", ComboBox1.Text)
cmd.Parameters. AddWithValue("@ sex", ComboBox2.Text)
cmd.Parameters. AddWithValue("@ feetype", ComboBox3.Text)
cmd.Parameters. AddWithValue("@ mothersname", TextBox6.Text)
cmd.Parameters. AddWithValue("@ fathersname", TextBox7.Text)
cmd.Parameters. AddWithValue("@ dd", ComboBox4.Text)
cmd.Parameters. AddWithValue("@ mm", ComboBox5.Text)
cmd.Parameters. AddWithValue("@ yy", ComboBox6.Text)
cmd.Parameters. AddWithValue("@ age", TextBox8.Text)
cmd.Parameters. AddWithValue("@ residentialaddr ess", TextBox9.Text)
cmd.Parameters. AddWithValue("@ city", ComboBox7.Text)
cmd.Parameters. AddWithValue("@ state", ComboBox8.Text)
cmd.Parameters. AddWithValue("@ country", ComboBox9.Text)
cmd.Parameters. AddWithValue("@ pincode", TextBox3.Text)
cmd.Parameters. AddWithValue("@ religion", ComboBox10.Text )
cmd.Parameters. AddWithValue("@ bloodgroup", ComboBox11.Text )
cmd.Parameters. AddWithValue("@ telephoneno", TextBox11.Text)
cmd.Parameters. AddWithValue("@ mobile", TextBox10.Text)
cmd.Parameters. AddWithValue("@ pager", TextBox12.Text)
cmd.Parameters. AddWithValue("@ email", TextBox13.Text)
con.Open()
cmd.ExecuteNonQ uery()
con.Close()
MsgBox("record added")
End Sub[/code]
i am making project on vb.net language..and project is on hospital management..its major project..and too many fields are present in its data base..i was connecting data base in forms but there is coming error..SIR PLEASE SORT OUT ERROR FROM MY COADING..what can i do to solve this error please give me sugession or if you can send me coading for adding information from form.than i will be thankfull to u..i have written all fields which has present in my database please help me..
error coming - too many parameters.
I HAVE MADE DATABASE ON MS ACCESS
SOURCE CODE -
[code=vbnet]
Dim cmd As New OleDbCommand("i nsert into table1 values(@date,@f irstname,@middl ename,@lastname ,@maritalstatus ,@sex,@feetype,
@mothersName,@f athersname,@dd, @mm,@yy,@age,@r esidentialaddre ss,@city,@state ,@country,@pinc ode,@religion,@ bloodgroup,@tel ephoneno, @mobile,@pager, @email)", con)
cmd.parameters. addwithvalue("@ date", TextBox2.Text)
cmd.Parameters. AddWithValue("@ firstname", TextBox14.Text)
cmd.Parameters. AddWithValue("@ middlename", TextBox4.Text)
cmd.Parameters. AddWithValue("@ lastname", TextBox5.Text)
cmd.Parameters. AddWithValue("@ maritalstatus", ComboBox1.Text)
cmd.Parameters. AddWithValue("@ sex", ComboBox2.Text)
cmd.Parameters. AddWithValue("@ feetype", ComboBox3.Text)
cmd.Parameters. AddWithValue("@ mothersname", TextBox6.Text)
cmd.Parameters. AddWithValue("@ fathersname", TextBox7.Text)
cmd.Parameters. AddWithValue("@ dd", ComboBox4.Text)
cmd.Parameters. AddWithValue("@ mm", ComboBox5.Text)
cmd.Parameters. AddWithValue("@ yy", ComboBox6.Text)
cmd.Parameters. AddWithValue("@ age", TextBox8.Text)
cmd.Parameters. AddWithValue("@ residentialaddr ess", TextBox9.Text)
cmd.Parameters. AddWithValue("@ city", ComboBox7.Text)
cmd.Parameters. AddWithValue("@ state", ComboBox8.Text)
cmd.Parameters. AddWithValue("@ country", ComboBox9.Text)
cmd.Parameters. AddWithValue("@ pincode", TextBox3.Text)
cmd.Parameters. AddWithValue("@ religion", ComboBox10.Text )
cmd.Parameters. AddWithValue("@ bloodgroup", ComboBox11.Text )
cmd.Parameters. AddWithValue("@ telephoneno", TextBox11.Text)
cmd.Parameters. AddWithValue("@ mobile", TextBox10.Text)
cmd.Parameters. AddWithValue("@ pager", TextBox12.Text)
cmd.Parameters. AddWithValue("@ email", TextBox13.Text)
con.Open()
cmd.ExecuteNonQ uery()
con.Close()
MsgBox("record added")
End Sub[/code]
Comment