try
{
SPWeb currentWeb = SPContext.Current.Web;
Microsoft.SharePoint.Client.ClientContext ctx = new
Microsoft.SharePoint.Client.ClientContext(currentWeb.Url);
Microsoft.SharePoint.Client.List lstLogin =
ctx.Web.Lists.GetByTitle("Login");
Microsoft.SharePoint.Client.CamlQuery sQuery =
Microsoft.SharePoint.Client.CamlQuery.CreateAllItemsQuery();
sQuery.ViewXml = @"<View><FieldRef Name='Title' /><FieldRef
Name='Password' /><Query><Where><Eq><FieldRef Name='ID' /><Value
Type='Counter'>" + ddlID.SelectedItem.Value + "</Value></Eq></Where></
Query></View>";
Microsoft.SharePoint.Client.ListItemCollection myColl =
lstLogin.GetItems(sQuery);
ctx.Load(myColl);
ctx.ExecuteQuery();
if (myColl.Count > 0)
{
foreach (Microsoft.SharePoint.Client.ListItem item in myColl)
{
txtUserName.Text = item["Title"].ToString();
txtPassWord.Text = item["Password"].ToString();
ctx.Load(lstLogin.GetItems(sQuery));
{
strError += ex.ToString();
}
{
SPWeb currentWeb = SPContext.Current.Web;
Microsoft.SharePoint.Client.ClientContext ctx = new
Microsoft.SharePoint.Client.ClientContext(currentWeb.Url);
Microsoft.SharePoint.Client.List lstLogin =
ctx.Web.Lists.GetByTitle("Login");
Microsoft.SharePoint.Client.CamlQuery sQuery =
Microsoft.SharePoint.Client.CamlQuery.CreateAllItemsQuery();
sQuery.ViewXml = @"<View><FieldRef Name='Title' /><FieldRef
Name='Password' /><Query><Where><Eq><FieldRef Name='ID' /><Value
Type='Counter'>" + ddlID.SelectedItem.Value + "</Value></Eq></Where></
Query></View>";
Microsoft.SharePoint.Client.ListItemCollection myColl =
lstLogin.GetItems(sQuery);
ctx.Load(myColl);
ctx.ExecuteQuery();
if (myColl.Count > 0)
{
foreach (Microsoft.SharePoint.Client.ListItem item in myColl)
{
txtUserName.Text = item["Title"].ToString();
txtPassWord.Text = item["Password"].ToString();
ctx.Load(lstLogin.GetItems(sQuery));
}
}
}
catch (Exception ex) }
}
{
strError += ex.ToString();
}
No comments:
Post a Comment