Coder Social home page Coder Social logo

devexpress-examples / how-to-bind-schedulercontrol-to-an-sql-server-database-and-customize-update-delete-insert-qu-e4436 Goto Github PK

View Code? Open in Web Editor NEW
0.0 55.0 0.0 54 KB

Bind the Scheduler control to an SQL Server database and generate queries without the use of SqlCommandBuilder

License: Other

C# 73.37% TSQL 13.16% Visual Basic .NET 13.47%
dotnet xtrascheduler-suite winforms data-binding database scheduler sql sql-server windows-forms

how-to-bind-schedulercontrol-to-an-sql-server-database-and-customize-update-delete-insert-qu-e4436's Introduction

WinForms Scheduler - Bind to an SQL Server database and customize Update-Delete-Insert queries without the use of SqlCommandBuilder

This example demonstrates how to bind the WinForms Scheduler control at runtime. The example shows how to configure appointment mappings and SQL queries in code. This technique allows you to easily modify data-binding options and SQL queries.

In this example, we insert a GETDATE function result into a TimeStamp column to save the modification time along with the modified row:

INSERT INTO CarScheduling (StartTime, EndTime, Subject, TimeStamp) VALUES (@StartTime, @EndTime, @Subject, GetDate())

UPDATE CarScheduling SET StartTime = @StartTime, EndTime = @EndTime, Subject = @Subject, TimeStamp = GetDate() WHERE ID = @ID

DELETE FROM CarScheduling WHERE ID = @ID

Do the following to test this example locally:

  • Set up the "SchedulerBindDynamically" sample database in your SQL Server instance.
  • Use the SchedulerBindDynamically.sql file attached to this example to generate a sample database and table schema.

Note

We do not use the SqlCommandBuilder class to generate SQL queries as shown in How to bind SchedulerControl to MS SQL Server database at runtime. The DbCommandBuilder.ConflictOption property enables optimistic concurrency to prevent a concurrency violation error. Since we do not use this functionality, you might encounter this error when using this example. Read the following MSDN article for additional information: Introduction to Data Concurrency in ADO.NET.

Files to Review

See Also

how-to-bind-schedulercontrol-to-an-sql-server-database-and-customize-update-delete-insert-qu-e4436's People

Contributors

albertov05 avatar devexpressexamplebot avatar iam0k avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.