Usha Raj

Usha Raj

  • NA
  • 144
  • 59.7k

Error Converting nvarchar to int

Apr 6 2015 3:24 AM
Am trying to add the table column value into another table ,the column data type is varchar(.i.e QQ20150001),but while adding into another table am getting the error like "Error Converting nvarchar to int" 
 
my code is:
 
page.DAL 
public void SaveData(string JobTitle, string RequiredExp,string JobLocation,int RegistrationId,string RequirementId)
{
SqlConnection con = dbcon.OpenCoonection( );
SqlCommand cmd = new SqlCommand("USP_InsertSavedJobs", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@JobTitle", JobTitle);
cmd.Parameters.Add("@RequiredExp", RequiredExp);
cmd.Parameters.Add("@JobLocation", JobLocation);
cmd.Parameters.AddWithValue("@RegId", RegistrationId);
cmd.Parameters.Add("@RequirementId", RequirementId);// Am getting the this value from other table by using session 
cmd.ExecuteNonQuery();
dbcon.CloseConnection();
}
 
Can any one tell me what's going wrong? 
 

Answers (20)