Configure SQL Data Sources for Web Applications

how to use sql data sources n.w
1 / 20
Embed
Share

"Learn how to create, define connections, and save SQL data sources in web applications. Follow step-by-step instructions for setting up database connections, saving connection strings in web.config files, and managing custom statements and stored procedures."

  • SQL Data Sources
  • Web Applications
  • Connection Configuration
  • Database Management
  • Stored Procedures

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. How to use SQL data sources SANTOSHI ELLANKI PRESENTATION ID #22

  2. Outline How to create an SQL data source control. How to define connection and save it in web web.config file. How to use custom statements and stored procedures.

  3. How to create an SQL data source control To create a SQL data source control, drag the control item from the data group of the Toolbox onto the form. Then choose configure data source from the control smart tag menu and proceed from their. You can also create a SQL data source using the choose data source command in the smart tag menu of bindable control.

  4. THE STARTING DIALOG BOX OF THE DATASOURCE CONFIGUARATION WIZARD

  5. HOW TO DEFINE THE CONNECTION The configure data source dialog box asks you to identify connection for the database you want to use. If you have previously created a connection for the database, you can select it from drop-down list. To create a new connection, click the new connection button to display the add connection dialog box. Then enter the name of the database server in the server name text box.

  6. For SQL server express, you can use localhost\sqlexpress as the server name. After you enter the server name, select the authentication mode you want to use. Then select the database you want to connect to from the drop-down box or enter a database name. To be sure that the connection is configured properly, you can click the test connection button.

  7. THE DIALOG BOX FOR DEFINING A CONNECTION

  8. HOW TO SAVE THE CONNECTION STRING IN WEB.CONFIG FILE ASP.NET applications can store connection strings in the web.config file. If you choose to save the connection string in the web.config file, the connection string attribute of data source control will include a special code that retrieves connection string from web.config file otherwise it will specify actual connection string.

  9. It is recommended to save the connection in web.config file. Then if the location of the database changes, you can change the connection string in web.config file rather than in each data source that uses the connection.

  10. THE DIALOG BOX FOR SAVING THE CONNECTION STRING IN WEB.CONFIG FILE

  11. How to configure the select statement To configure the select statement you choose whether you want to use custom SQL statement or specify the columns from the table or view in the database. You can click the ORDER BY button to specify how the records should be stored. You can click the WHERE button to specify the selection criteria

  12. The dialog box for defining the select statement

  13. HOW TO CREATE A WHERE CLAUSE The add WHERE clause dialog box lets you specify a where clause for select statement. To create a condition, you select the column you want to compare, the operator you want to use for the comparison and the source of the data that you want to use for the comparison. Then you must click Add to add the condition to the list of where clause condition.

  14. THE ADD WHERE CLAUSE DIALOG BOX

  15. The where clause section after a condition has been added

  16. HOW TO USE CUSTOM STATEMENTS AND STORED PROCEDURES How to select custom statements and stored procedures To use custom statements with SQL data source, select the SQL statement option and then enter the statement into text box. You can enter select, update, insert, and delete statements by selecting the appropriate tab. To use stored procedures, select stored procedure option and then select stored procedure you want to use from the drop-down list.

  17. THE DIALOG FOR ENTERING A CUSTOM SELECT STATEMENT

  18. THANK YOU

  19. QUERIES ?

Related


More Related Content