Stored Procedure successfull execution using LINQ
I'm updating some value through stored procedure using LINQ. How would I be able to know that the updation has been performed successfully on table like we got to know in ADO.net where ExecuteNonQuery() Function returns the no of affected values.
Suthish NairPosted Jan 21, 2011, 3:38 PM
check What Happens if the SPROC Throws an Error?
Vahaj uddinPosted Jan 21, 2011, 1:55 PM
@Sam I don't know you are not getting my English or what. Amit posted the URL which is about retrieving data through stored procedure using LINQ. And I clearly mentioned that I'm updating some thing(Not retrieving), I'm updating some column value and how would be I able to know how many rows have been updated successfully.
In ADO.net we used to do that
int i = commandObject.ExecuteNonQuery();
If i=0 that means no row updated if i>=1 that means 1 or more then 1 rows have been updated successfully.
I also need the same functionality (That I mentioned above) while using LINQ. Did u get now??
Sam HobbsPosted Jan 21, 2011, 11:05 AM
Vahaj uddinPosted Jan 21, 2011, 7:14 AM
Amit ChoudharyPosted Jan 21, 2011, 6:30 AM
Here is the right thing you should go through how to use stored procedure using the LINQ.
http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/4913/Default.aspx
Thanks