Hi I have seen that some use the code below while saving in the database:
public bool Save()
{
ProductId = Convert.ToInt32(SqlHelper.ExecuteScalar(SqlHelper.GetConnection(), "SaveProduct", ProductId, ProductName)
return true;
}
public bool Save()
{
SqlHelper.ExecuteNonQuery(SqlHelper.GetConnection(), "SaveProduct", ProductId, ProductName);
return true;
}
My question is what is the difference between both code,which is better to use than the other,when to use them.And please explain me the first one,I do not understand very well that code.The second one is ok I can understand.
Thanks!