Hi,
While executing the com.com.Execute NonQuery() error it shows the error as
ERROR [42000] [Microsoft][SQL Native Client][SQL Server]Procedure or Function 'AddCustomer' expects parameter '@ID', which was not supplied.
But i am passing the parameter..
Please help me.
Here is the Code
OdbcCommand com = new OdbcCommand("Ad dCustomer",conn );
com.CommandType = CommandType.Sto redProcedure;
com.Parameters. Add("@ID", OdbcType.NVarCh ar,12,"20" );
com.Parameters. Add("@FName", OdbcType.NVarCh ar, 50, (txtFirstName.T ext));
com.Parameters. Add("@LName", OdbcType.NVarCh ar, 30, txtLastName.Tex t);
com.Parameters. Add("@Add1", OdbcType.NVarCh ar, 50, txtAdd1.Text);
com.Parameters. Add("@Add2", OdbcType.NVarCh ar, 50, txtAdd2.Text);
com.Parameters. Add("@City", OdbcType.NVarCh ar, 50, drpState.Text);
com.Parameters. Add("@State", OdbcType.NVarCh ar, 20, drpState.Text);
com.Parameters. Add("@Pincode", OdbcType.NVarCh ar, 6, txtPincode.Text );
com.Parameters. Add("@Phone", OdbcType.NVarCh ar, 25, txtPhone.Text);
com.Parameters. Add("@Country", OdbcType.NVarCh ar, 20, txtCountry.Text );
com.Parameters. Add("@Email", OdbcType.NVarCh ar, 50, txtEmail.Text);
com.ExecuteNonQ uery();
While executing the com.com.Execute NonQuery() error it shows the error as
ERROR [42000] [Microsoft][SQL Native Client][SQL Server]Procedure or Function 'AddCustomer' expects parameter '@ID', which was not supplied.
But i am passing the parameter..
Please help me.
Here is the Code
OdbcCommand com = new OdbcCommand("Ad dCustomer",conn );
com.CommandType = CommandType.Sto redProcedure;
com.Parameters. Add("@ID", OdbcType.NVarCh ar,12,"20" );
com.Parameters. Add("@FName", OdbcType.NVarCh ar, 50, (txtFirstName.T ext));
com.Parameters. Add("@LName", OdbcType.NVarCh ar, 30, txtLastName.Tex t);
com.Parameters. Add("@Add1", OdbcType.NVarCh ar, 50, txtAdd1.Text);
com.Parameters. Add("@Add2", OdbcType.NVarCh ar, 50, txtAdd2.Text);
com.Parameters. Add("@City", OdbcType.NVarCh ar, 50, drpState.Text);
com.Parameters. Add("@State", OdbcType.NVarCh ar, 20, drpState.Text);
com.Parameters. Add("@Pincode", OdbcType.NVarCh ar, 6, txtPincode.Text );
com.Parameters. Add("@Phone", OdbcType.NVarCh ar, 25, txtPhone.Text);
com.Parameters. Add("@Country", OdbcType.NVarCh ar, 20, txtCountry.Text );
com.Parameters. Add("@Email", OdbcType.NVarCh ar, 50, txtEmail.Text);
com.ExecuteNonQ uery();
Comment