I have a method
public void DeleteItem(int ImgId, int ImgNos, int ListId)
{
object[] objParams = {0,ImgId};
SqlHelper.ExecuteNonQuery(Conn, "DeleteItem",objParams);
if (ItemNos == 2)
{
ChangeItem(ListId);
}
}
in deleteitem sp i am return the value as 0 or 1 now i want to get the return value on my btn click and want to check if return value is 0 then do some task and if return value is 1 then do some other task how to do that?
objGetBase.DeleteItem(ItemId, ItemNos, Convert.ToInt32(ViewState["ListId"]));
// here i want to check the return value if return = 0 then go to next step else not
string path1 = Path.Combine(GetDirectory(ItemName), ItemName);
File.Delete(path1);
It looks like you are using the Microsoft library with SqlHelper?
If you are things are quite simple, if you use
ExecuteScalar, instead ofExecuteNonQueryyou will get returned an object.here is a link to some examples using that Libraray:
http://msdn.microsoft.com/en-us/library/ff647281.aspx
From this it should be quite straightforward:
int returnValue = (int)SqlHelper.ExecuteScalar(Conn, "DeleteItem",objParams);