小编use*_*131的帖子

如何使用linq to sql一次更新多行?

表:

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一次].?

谢谢

c# linq entity-framework linq-to-sql

89
推荐指数
3
解决办法
14万
查看次数

当应用程序在Windows Phone 7中启动时,如何显示不同的页面?

当app启动时需要显示注册page.once用户注册它不应该去注册页面需要登录页面.怎么做到这一点?

windows-phone-7

9
推荐指数
1
解决办法
2555
查看次数

在wcf中找不到404文件或目录?

为什么我404 file or directory not found在WCF中遇到问题?

我有一个带有两个IP的客户端系统,一个是本地的,另一个是全局的.我使用本地IP发布了文件.

我得到了结果,但使用全局IP我得到了404 file or directory not found错误.

是什么造成的?

wcf http-status-code-404

4
推荐指数
1
解决办法
6790
查看次数

Windows Phone 7中的跨线程访问无效?

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-phone-7

4
推荐指数
2
解决办法
3565
查看次数

3
推荐指数
1
解决办法
2351
查看次数

为什么列表框选择在Windows Phone 7中无法正常工作?

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项目然后能够导航到子类别页面. ....

windows-phone-7

2
推荐指数
1
解决办法
710
查看次数

如何使用linq解析下面的xml字符串到xml?

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中的所有记录?

c# xml linq-to-sql

1
推荐指数
1
解决办法
94
查看次数