Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
public int update(string SP_Name)
{
c = new DBaccess();
int a;
c.connect();
c.cmd = new SqlCommand(SP_Name, c.con);
c.cmd.CommandType = CommandType.StoredProcedure;
c.cmd.Parameters.AddWithValue("@stid", _stid);
c.cmd.Parameters.AddWithValue("@sname", _sname);
c.cmd.Parameters.AddWithValue("@dob", _dob);
c.cmd.Parameters.AddWithValue("@gender", _gender);
c.cmd.Parameters.AddWithValue("@photo", _photo);
c.cmd.Parameters.AddWithValue("@mname", _mname);
c.cmd.Parameters.AddWithValue("@fname", _fname);
c.cmd.Parameters.AddWithValue("@saddress", _saddress);
c.cmd.Parameters.AddWithValue("@mobileno", _mobileno);
a = c.cmd.ExecuteNonQuery();
c.disconnect();
if (a > 0 && (countstid() > 0))
{
return 1;
}
else
{
return -1;
}
}

What I have tried:

public int update(string SP_Name)
{
c = new DBaccess();
int a;
c.connect();
c.cmd = new SqlCommand(SP_Name, c.con);
c.cmd.CommandType = CommandType.StoredProcedure;
c.cmd.Parameters.AddWithValue("@stid", _stid);
c.cmd.Parameters.AddWithValue("@sname", _sname);
c.cmd.Parameters.AddWithValue("@dob", _dob);
c.cmd.Parameters.AddWithValue("@gender", _gender);
c.cmd.Parameters.AddWithValue("@photo", _photo);
c.cmd.Parameters.AddWithValue("@mname", _mname);
c.cmd.Parameters.AddWithValue("@fname", _fname);
c.cmd.Parameters.AddWithValue("@saddress", _saddress);
c.cmd.Parameters.AddWithValue("@mobileno", _mobileno);
a = c.cmd.ExecuteNonQuery();
c.disconnect();
if (a > 0 && (countstid() > 0))
{
return 1;
}
else
{
return -1;
}
}
asp.net in c#
Posted
Updated 28-Dec-17 0:40am

1 solution

Without seeing your code in its entirety, we can;t be sure. But ... from taht fragment, I'd suspect that your countstid method is declared as:
C#
void countdtid()
   {
   ...
   }
As it's the only "int to possible void" comparison in that fragment.
 
Share this answer
 

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