LINQ

1. int id = Convert.ToInt32(Request.Params["帐号编号ID"]); 
        if(id != 0)
        {        
            GoldenSeaDataDataContext context = new GoldenSeaDataDataContext();
            LinqDataSourceLoanbase.Where = "帐号编号ID.Value.Equals(" + id + ")";
        }    

2. int id = (from b in context.Base_accounts where b.账号 == 账号RadComboBox.Text select b.帐号编号ID).First<int>();  //选择字段值

    string userid = (from u in context.aspnet_Memberships where u.人员编号 == 人员编号TextBox.Text select u.UserId).First().ToString();  //选择字段值

   

3.        YzCiticDBDataDataContext context = new YzCiticDBDataDataContext(); 
            var recordlist = from u in context.Records select u;
            foreach (Record r in recordlist)
            {
                XmlElement headNode = doc.CreateElement("", "Record", "");
                XmlElement xmlText = doc.CreateElement("bill_time");
                xmlText.InnerText = r.bill_time.ToString();
                headNode.AppendChild(xmlText);

                XmlElement xmlText1 = doc.CreateElement("", "bank_order_no", "");
                xmlText1.InnerText = r.bank_order_no;
                headNode.AppendChild(xmlText1);

                XmlElement xmlText2 = doc.CreateElement("", "bill_type", "");
                xmlText2.InnerText = r.bill_type.ToString();
               root.AppendChild(headNode);             

            }

 

阅读更多
文章标签: linq string
个人分类: linq
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭