Dear Friends
I worked with VB.NET V 2005
In my project i have using so many sql statements (insert, update..) those working properly
In newly i created form i have coded sql insert statement
so when i execute it its getting error "Number of query values and destination fields are not the same"
so friend i cant recognize what is this error
this is my error code
Com.CommandText = "Insert into tblReservation Values(?,?,?,?,?,?,?,?)"
With Com.Parameters
.Add("@CusID", OleDbType.VarChar).Value = CusNo
.Add("@ResType", OleDbType.VarChar).Value = ResTyp
.Add("@RTType", OleDbType.VarChar).Value = RTbTyp
.Add("@RTNo", OleDbType.Integer).Value = RoTbNo
.Add("@ResDate", OleDbType.Date).Value = txtDate.Text
.Add("@OutDate", OleDbType.DBDate).Value = txtOutDt.Text
.Add("@AddPay", OleDbType.Integer).Value = txtAdvPay.Text
.Add("@Stat", OleDbType.VarChar).Value = "Yes"
End With
MsgBox(Com.CommandText)
MsgBox(Com.Parameters)
Com.ExecuteNonQuery()
Com.Parameters.Clear()
this is the code its properly worked
Com.CommandText = "Insert into tblCustomer Values(?,?,?,?,?,?,?,?,?,?,?)"
With Com.Parameters
.Add("@CID", OleDbType.VarChar).Value = txtCustID.Text
.Add("@CName", OleDbType.VarChar).Value = txtCustName.Text
.Add("@Gender", OleDbType.VarChar).Value = cboGender.Text
.Add("@DOB", OleDbType.VarChar).Value = cboDOB.Text
.Add("@Address", OleDbType.VarChar).Value = txtAddress.Text
.Add("@City", OleDbType.VarChar).Value = txtCity.Text
.Add("@State", OleDbType.VarChar).Value = txtState.Text
.Add("@Country", OleDbType.VarChar).Value = txtCountry.Text
.Add("@Nationality", OleDbType.VarChar).Value = txtNationality.Text
.Add("@IDType", OleDbType.VarChar).Value = cmbIDType.Text
.Add("@IDNo", OleDbType.VarChar).Value = txtCardNo.Text
End With
' MsgBox(Com)
Com.ExecuteNonQuery()
please try to help me to solve this matter
Thanks in Advanced
Nelson Rodrigo