表:
id userid friendid name status
1 1 2 venkat false
2 1 3 sai true
3 1 4 arun false
4 1 5 arjun false
Run Code Online (Sandbox Code Playgroud)
如果用户发送userid = 1,则friendids = 2,4,5 status = true
请告诉我如何更新以上所有friendids状态的查询是真的.[2,3,4一次].?
谢谢
当app启动时需要显示注册page.once用户注册它不应该去注册页面需要登录页面.怎么做到这一点?
为什么我404 file or directory not found在WCF中遇到问题?
我有一个带有两个IP的客户端系统,一个是本地的,另一个是全局的.我使用本地IP发布了文件.
我得到了结果,但使用全局IP我得到了404 file or directory not found错误.
是什么造成的?
void GetResponseCallback(IAsyncResult asynchronousResult)
{
try
{
HttpWebRequest request = (HttpWebRequest)asynchronousResult.AsyncState;
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asynchronousResult);
Stream streamResponse = response.GetResponseStream();
StreamReader streamRead = new StreamReader(streamResponse);
string responseString = streamRead.ReadToEnd();
XmlReader xmlDoc = XmlReader.Create(new MemoryStream(System.Text.UTF8Encoding.UTF8.GetBytes(responseString)));
while (xmlDoc.Read())
{
if (xmlDoc.NodeType == XmlNodeType.Element)
{
if (xmlDoc.Name.Equals("ResponseCode"))
{
responseCode = xmlDoc.ReadInnerXml();
}
}
}
if (Convert.ToInt32(responseCode) == 200)
{
MessageBox.Show("Success");
}
// Close the stream object
streamResponse.Close();
streamRead.Close();
// Release the HttpWebResponse
response.Close();
}
catch (WebException e)
{
// Error treatment
// ...
}
} …Run Code Online (Sandbox Code Playgroud) 在 Windows 8 应用程序中使用休息服务发布方法的任何示例。请让我知道可能的链接。
microsoft-metro windows-8 windows-runtime dotnet-httpclient windows-store-apps
private void PersonalInfoList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
System.Collections.IList list = e.AddedItems;
if (e.AddedItems.Count == 1)
{
IEnumerable<Category> categs = list.Cast<Category>();
Category em = categs.ElementAt<Category>(0);
int id = em.id;
int categoryid = em.categoryid;
string subcategoryname = em.subcategname;
NavigationService.Navigate(new Uri(String.Format("/SubCategories.xaml?id=" + id + "&categoryid=" + categoryid + "&subcategoryname=" + subcategoryname), UriKind.Relative));
}
}
Run Code Online (Sandbox Code Playgroud)
如果列表中有2个项目,如果单击第一个项目然后能够导航到子类别页面.但是再次单击相同的第一个项目无法导航.如果单击第一个项目后单击2项目然后能够导航到子类别页面. ....
XML:
<shift_details>
<shift_time>10:00 to 10:30</shift_time>
<count>0</count>
<shift_time>10:30 to 11:00</shift_time>
<count>0</count>
<shift_time>11:00 to 11:30</shift_time>
<count>0</count>
<shift_time>11:30 to 12:00</shift_time>
<count>0</count>
<shift_time>12:00 to 12:30</shift_time>
<count>0</count>
</shift_details>
Run Code Online (Sandbox Code Playgroud)
码:
var slots = from c in xmlResponse.Descendants("shift_details")
select new TimeSlots
{
time = (string)c.Element("shift_time"),
count = (string)c.Element("count"),
};
Run Code Online (Sandbox Code Playgroud)
上面的代码只返回一个插槽项作为输出.但我的xml包含太多记录.
如何读取上面xml中的所有记录?