How to create a schduler with database programatically

5 posts, 1 answers
  1. Anoop
    Anoop avatar
    18 posts
    Member since:
    Dec 2012

    Posted 26 Dec 2012 Link to this post

    You had provided the Programatically mapping in scheduler help.But i want to create scdulerdatdataset, apointmentsBindingsource,apointmenttableadpet etc using code not but design form
    Is it possible.My application need to create a database then save the scheduler data to the newly created database and save .Each time i want the user to determine database name& location.If some part is done in design it is not possible.Any way?
  2. Jeff
    Jeff avatar
    48 posts
    Member since:
    Apr 2012

    Posted 27 Dec 2012 Link to this post

    What database format will you use? Different databases have different methods to pragmatically create them. For example, SQL can attach a database from file, or queries can be used to create the database. You can create your own XML or other text based database. Access databases are also easy to create at run time. Your dataset can be created and mapped to the RadScheduler at design time but you will create the database and load the dataset at run time.

    If I've misunderstood your question, I apologize.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Anoop
    Anoop avatar
    18 posts
    Member since:
    Dec 2012

    Posted 27 Dec 2012 Link to this post

    Yes i want to load database at runtime as per user input.I use sql database.I don't know to how to load database at runtime.
  5. Answer
    Jeff
    Jeff avatar
    48 posts
    Member since:
    Apr 2012

    Posted 27 Dec 2012 Link to this post

    Do you need to create the database or just the connection to the database? If you need to create the database it might be best to include a starter database and attach it once the user has selected the SQL server and provided credentials. If the user is familiar with SQL they may want to attach the database and supply their own permissions. Some of my larger customers prefer tighter control and manage the database.

    You can also use the MS Data Connection UI. http://archive.msdn.microsoft.com/Connection/Release/ProjectReleases.aspx?ReleaseId=3863
     
    The data connection dialog document on that page explains how to use the UI. You just save the connection string it returns. It can also attach a database from a file.

    To load the database at run time, I first establish the connection in my development environment. This gives you an application setting for the connection string. Add code to check the string and if the connection string is invalid use the UI to allow them to create the proper connection string. Save this string to the application setting like this My.Settings.YourConnectionString = TheStringFromUI. Now you have a saved string that you can use right before Tableadapter.Fill. Use the this new connection string like this:  YourTableAdapter.Connection.ConnectionString = My.Settings.YourConnectionString

    There's a lot of examples of this once you know what to look for.
  6. Anoop
    Anoop avatar
    18 posts
    Member since:
    Dec 2012

    Posted 28 Dec 2012 Link to this post

    Thanks Jeff that saved me
Back to Top
UI for WinForms is Visual Studio 2017 Ready