Note:-
Here Title is the Primary Key.
string strPassWord=string.Empty;
var context = new
LinqSampleDataContext(SPContext.Current.Web.Url);
EntityList<LoginItem> login_Insert =
context.GetList<LoginItem>("Login");
var query = from cs in login_Insert
where cs.Title.ToString() == txtUserName.Text
select new
{
strPassWord=cs.Password
};
if (query.Count() > 0)
{
foreach (var q in query)
{
txtPassWord.Text = q.strPassWord;
break;
}
}
else
{
this.Controls.Add(new LiteralControl("No Record
Found"));
}
Here Title is the Primary Key.
string strPassWord=string.Empty;
var context = new
LinqSampleDataContext(SPContext.Current.Web.Url);
EntityList<LoginItem> login_Insert =
context.GetList<LoginItem>("Login");
var query = from cs in login_Insert
where cs.Title.ToString() == txtUserName.Text
select new
{
strPassWord=cs.Password
};
if (query.Count() > 0)
{
foreach (var q in query)
{
txtPassWord.Text = q.strPassWord;
break;
}
}
else
{
this.Controls.Add(new LiteralControl("No Record
Found"));
}
No comments:
Post a Comment