i am using Linq to sql
and my code is
Expand|Select|Wrap|Line Numbers
- public class AccountSettings
- {
- NewCustomerDataContext _dbAccounts = new NewCustomerDataContext();
- public int UpdateAccountSettigs(int iUserLoginID,string strUserMailID, string strPassword)
- {
- var UpdateUser = _dbAccounts.UserLoginInfs.Single(e => e.UserLoginInfID == iUserLoginID);
- UpdateUser.UserMailID = strUserMailID;
- UpdateUser.Password = strPassword;
- _dbAccounts.SubmitChanges();
- }
- }
at the code
var UpdateUser = _dbAccounts.UserLoginInfs.Single(e => e.UserLoginInfID == iUserLoginID);
if no records are there with that criteria i am getting error.
so how do i validate this?
With earlier technology, when no records are found, we used to get 0 or something.
but how do we handle it in this case
also after executing
_dbAccounts.SubmitChanges();
how do i confirm that the update is success?
its return type is void
so how do i capture the result
thank you
Ravindar