I have gotten two lists (like a view) from Microsoft Dynamics CRM. How can I get a elements from these two lists to the C# Sharepoint code in .cs file. The Administrator of CRM told me that this lists are made by Business Data Connectivity. How can I call them from the code? How to put CAML Query to it?
Edited.
Here is my example of code:
string FullQueryUrlap = "<Where><And><Geq><FieldRef Name='{0}' /><Value IncludeTimeValue='TRUE' Type='DateTime'>{1}</Value></Geq><And><Leq><FieldRef Name='{2}' /><Value IncludeTimeValue='TRUE' Type='DateTime'>{3}</Value></Leq><And><Eq><FieldRef Name='Nazwisko' /><Value Type='Note'>{4}</Value></Eq><Eq><FieldRef Name='Imie' /><Value Type='Note'>{5}</Value></Eq></And></And></And></Where>";
string dateISO1 = SPUtility.CreateISO8601DateTimeFromSystemDateTime(e.Day.Date.ToUniversalTime().AddHours(1.0));
Convert.ToDateTime(dateISO1);
string dateISO2 = SPUtility.CreateISO8601DateTimeFromSystemDateTime(e.Day.Date.ToUniversalTime().AddHours(2.0));
Convert.ToDateTime(dateISO2);
int spacja = DropDownList1.SelectedItem.Text.IndexOf(" ");
var queryPoszczegolnyUrlop = new SPQuery();
queryPoszczegolnyUrlop.Query = String.Format(FullQueryUrlap, "DataKon", dateISO1, "DataPoc", dateISO2, DropDownList1.SelectedItem.Text.ToUpper().Substring(0, spacja), DropDownList1.SelectedItem.Text.ToUpper().Substring(spacja+1));
queryPoszczegolnyUrlop.ViewFields = "<FieldRef Name='Title' /><FieldRef Name='DataPoc' /><FieldRef Name='DataKon' />";
queryPoszczegolnyUrlop.ViewFieldsOnly = true;
// Wyświetlanie poszczególnego pracownika wybranego z DropDownList1
// Label2.Text = DropDownList1.SelectedItem.Text.ToUpper().Substring(0, spacja) + DropDownList1.SelectedItem.Text.ToUpper().Substring(0, spacja).Length + " | " + DropDownList1.SelectedItem.Text.ToUpper().Substring(spacja+1) + DropDownList1.SelectedItem.Text.ToUpper().Substring(spacja+1).Length;
SPListItemCollection listaDniUrlopow = witryna1.Lists["ListaUrlopow2012"].GetItems(queryPoszczegolnyUrlop);
DateTime dataPoc= new DateTime();
DateTime dataKon = new DateTime();
for (int interator = 0; interator < listaDniUrlopow.Count; interator++)
{
SPListItem item = listaDniUrlopow[interator];
dataPoc = Convert.ToDateTime(item["DataPoc"]);
dataKon = Convert.ToDateTime(item["DataKon"]);
Hov could I get a Internal name of the Esential list in BDC.