This is a migrated thread and some comments may be shown as answers.

Cannot Bind multiple DataSources

1 Answer 145 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
smith spd
Top achievements
Rank 1
smith spd asked on 16 Jun 2010, 07:15 AM
Hello Telerik Team,

I am trying to bind multiple datasources to the RadScheduler. For my code below, I am able to able to bind either Sharepoint List or Just SQL. Please help me correct my code so that I can support both datasources on the RadScheduler. Thanks.

       DataSet dS = new DataSet();      
                   DataTable dT = listItems.GetDataTable(); 
                   dS.Merge(dT);         
                   
     dT.Columns.Add("FromSql"); 
 
 
                   SqlDataAdapter myCnd = new SqlDataAdapter();    
                   myCnd = new SqlDataAdapter("select tID, tDATE, tTITLE, dDATE from myTable", strConn);  
                   DataSet dS1 = new DataSet();       
                   myCnd.Fill(dS1);          
                   foreach (DataRow row in dt.Rows) 
                   { 
                     
                       DataRow custdRow = dT.custdRow(); 
                       custdRow["ID"] = row["tID"].ToString(); 
                       custdRow["Title"] = row["tTITLE"].ToString(); 
                       custdRow["strtDate"] = row["tDATE"].ToString(); 
                       custdRow["endDate"] = row["dDATE"].ToString(); 
 
                       custdRow["FromSql"] = "Retrieve"
 
                       dT.Rows.Add(custdRow); 
 
                   } 
                   dS1.Merge(dT);        
                   dS.Merge(dS1,true);            
                 //RadScheduler1.DataSource = dT ;                   
                   RadScheduler1.DataSource = dS;   
                  
                  RadScheduler1.DataKeyField = "ID"
                  RadScheduler1.DataStartField = "strtDate"
                  RadScheduler1.DataEndField = "endDate"
                  RadScheduler1.DataSubjectField = "Title"
                  RadScheduler1.DataBind(); 

1 Answer, 1 is accepted

Sort by
0
smith spd
Top achievements
Rank 1
answered on 18 Jun 2010, 05:05 PM
Hello Telerik Team,

I have solved my problem of binding two data sources to a scheduler.

Scenario :

I have two data sources (sql,sharepoint list).I have iterated through the sql datarows and added them to
the sharepoint list datatable and then used the sharepoint list datatable as a datasource to the scheduler.

I was facing a issue of the  sql  data overwriiten by the sharepoint list data.The reason for that was the information from two datasources must consist of unique "ID" field..in my case..the ID field of sharepoint list and ID field of sql table were same.I made them the unique fields and it worked like a charm.

If anyone needed any information regarding this.I will be happy to help them.

Thank you Telerik team for the support.

Thank you
Smith

 

 



Tags
Scheduler
Asked by
smith spd
Top achievements
Rank 1
Answers by
smith spd
Top achievements
Rank 1
Share this question
or