Click here to Skip to main content
14,932,707 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
protected void btnsave_Click1(object sender, EventArgs e)
{
assignvalues();

{
x = s.insert("inserttblemployeedetail");
if (x > 0)
{
Interaction.MsgBox("Saved");
}
else
{
Interaction.Msgbox("Not Saved");
}
}
}
Posted

The message explains the error. This error quite obvious if you are trying to store an Integer Value in an string.

Following are checkpoint here in your code:
1. If s.insert is returning Integer then variable x should be an Integer.
2. If s.insert is returning String then variable x should be a String.



Try this:
C#
int x = s.insert("inserttblemployeedetail");
if (x > 0)
{
    Interaction.MsgBox("Saved");
}
else
{
    Interaction.Msgbox("Not Saved&");
}



--Amit
   
v2
Because insert function return type not match with variable x..
   
v3
Comments
RahulRana723 13-Jun-13 7:30am
   
Post your Insert function code ..for best solution
check data types for x. it looks like insert method is returning int and you are trying to store it in string
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900