I have added to the tables needed to run the calendar to our database.
When i run the application it insist on connecting to an old database created to test infragistics calendar.
I disabled the old database and now i get an error stating that it can not connect to a database.
My question is where is the connection string for the infragistics calendar set ?
wow, that's bad.
I agree, the documentation should be updated. I just spent 2 h dealing with not being able to connect to my datasource. Thanks for the solution Torrey.
Information that you're describing here about the workings of WebScheduleSqlClientProvider need to be placed into the documentation. This same type of thread has been created before, and the reason why they're getting confused is that the documentation has a walk-through with very simple steps that make it sound easy to use these controls (like it should be), and no mention of possible issues with inheriting from master pages and implement a solution for this situation.
The very first time I ran into this problem myself it took more than hour of playing with the controls and debugging till I figured what the problem was and developed the workaround that worked for me. I'm more a Windows application developer than a web developer, so when clients need something done for the web it's to their benefit and mine that the controls I decide to use to acheive their goal are properly documented if I should need to look up reference information, instead of living by trial and error.
Torrey said: I believe this to be a bug, 3. DO NOT SET a DataSourceID for the WebSceduleSqlClientProvider, but make sure you have the WebScheduleInfoID referencing the WebScheduleInfo you dropped in the first step. (Note: For some reason if you reference a connection string with WebScheduleSqlClientProvider when your calendar is being used on a content page of a master page it will *always* fail to connect to the datasource).
I believe this to be a bug,
3. DO NOT SET a DataSourceID for the WebSceduleSqlClientProvider, but make sure you have the WebScheduleInfoID referencing the WebScheduleInfo you dropped in the first step. (Note: For some reason if you reference a connection string with WebScheduleSqlClientProvider when your calendar is being used on a content page of a master page it will *always* fail to connect to the datasource).
Your code shows one way of setting the Connection.ConnectionString on the WebScheduleSqlClientProvider.
Two other ways the data provider can be told how to connect to the database are by setting the DataSourceID (which the data provider uses to retrieve the Connection String, however as described this will not work unless the fully-qualified ID of the Data Source control is used), or passing the connection string at run-time by the Connect method.
If you do not tell the data provider how to connect by one of the available means, it can't connect.
I believe this to be a bug, but have a work around you can try out that worked for me. Here's the steps to success:
WebScheduleSqlClientProvider1.Connection.ConnectionString = ConfigurationManager.ConnectionStrings["SweetSuccessConnectionString"].ConnectionString;
Be sure to change the connection string name to whatever it's called inside your Web.Config file. Now view the page in the browser and watch the magic happen!