GithubHelp home page GithubHelp logo

lexepox / how-to-bind-schedulercontrol-to-ms-sql-server-database-at-runtime-e551 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devexpress-examples/winforms-scheduler-bind-to-ms-sql-server

0.0 2.0 0.0 397 KB

.NET, XtraScheduler Suite

License: Other

C# 100.00%

how-to-bind-schedulercontrol-to-ms-sql-server-database-at-runtime-e551's Introduction

How to bind SchedulerControl to MS SQL Server database at runtime

This example shows how you can bind the SchedulerControl to an SQL Server database at runtime. The SqlCommandBuilder is used to generate SQL queries, however you can modify them as required or specify your own queries.
The project uses MS SQL Server database. You can create a new database using the .sql script file included in the project, or use already existing database. Check the code that specifies mappings to ensure that all data fields are correctly mapped to appointment properties.
Note that mappings for the Start and End appointment properties are required. The UniqueID field in the Appointments table is not mapped, however, because it is an identity auto-incremented field updated by MS SQL Sever itself. If you map it for whatever reason, make sure that the CommitIdToDataSource property is set to false.
This project sets the ResourceSharing property to true, so each appointment can be assigned to several resources. The corresponding resource IDs arte stored in XML format in the ResourceIDs field.
If the ResourceSharing property is false (by default), then the AppointmentMappingInfo.ResourceId property should be set to the database field containing the value of the resource ID with which an appointment is associated. Therefore, this field must have the same type as the resource ID. The Scheduler does not restrict the type of resource ID to a particular .NET type, so you can use any data type if the types of the corresponding fields in Appointment and Resource tables will match.

If your database server is not MS SQL, you can replace SqlDataAdapter and SqlCommandBuilder with the corresponding data adapter and command builder, such as OracleDataAdapter and OracleCommandBuilder.

Description

The sample for v2012 vol 2.4 and higher uses MS SQL Server database file included in the project. The database script is attached as the DXDBScheduler.sql file. Instead of System.Windows.Forms.BindingSource instances the SchedulerStorage is bound to the System.Data.Dataset object which provides data for appointments and resources. The dataset is filled by System.Data.SqlClient.SqlDataAdapter instances at runtime.


how-to-bind-schedulercontrol-to-ms-sql-server-database-at-runtime-e551's People

Contributors

devexpressexamplebot avatar lexepox avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.