Я пишу следующий код для преобразования 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
, это не работает.