4
我寫了下面的代碼到SQL轉換爲LINQ再到XML:轉換SQL到LINQ到XML
SqlConnection thisConnection = new SqlConnection(@"Data Source=3BDALLAH-PC;Initial Catalog=XMLC;Integrated Security=True;Pooling=False;");
thisConnection.Open();
XElement eventsGive =
new XElement("data",
from c in ??????
select new XElement("event",
new XAttribute("start", c.start),
new XAttribute("end",c.eend),
new XAttribute("title",c.title),
new XAttribute("Color",c.Color),
new XAttribute("link",c.link)));
Console.WriteLine(eventsGive);
表的名稱是「XMLC」,我想引用它。我怎樣才能做到這一點? 當我直接輸入它的名字VS給出錯誤。當我說thisConnection.XMLC
它不起作用。