时间:2010-07-24 17:22:35

标签: linq-to-xml

3 个答案:

答案 0 :(得分:2)

答案 1 :(得分:1)

试试这个:

XDocument feed = XDocument.Load("the link for the xml file");
feed.Save("type the link here");            

DataClasses1DataContext db = new DataClasses1DataContext();


var feedpost = from c in feed.Descendants("api_item")
               select new Table_1
               {
                   Title = c.Element("title").Value,
                   description = c.Element("description").Value

               };
db.Table_1s.InsertAllOnSubmit(feedpost);
db.SubmitChanges();

答案 2 :(得分:0)