i want to executescaler query that username & password is entered, if it is match with username & Password, it will return UserID.
I thought you needed to select the pswd given the id as you stated before:
i have below query :
Select txtPassword From CMS_Admin where intUserID=1
so now i want to execute this query by using ExecuteScaler()
Anyway, the code should look like the following
For Adapter:
IPredicateExpression filter = new PredicateExpression();
filter.Add(CmsAdminFields.UserName == username);
filter.Add(CmsAdminFields.Password == pswd);
DataAccessAdapter adapter = new DataAccessAdapter();
int id = (int)adapter.GetScalar(CmsAdminFields.UserId, null, null, filter);
For SelfServicing:
IPredicateExpression filter = new PredicateExpression();
filter.Add(CmsAdminFields.UserName == username);
filter.Add(CmsAdminFields.Password == pswd);
CmsAdminCollection col = new CmsAdminCollection();
int id = (int)col.GetScalar(CmsAdminFields.UserId, null, null, filter);