Click here to Skip to main content
15,891,033 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

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

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



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