.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Articles >> .Net Framework >> Post New Resource Bookmark and Share   

 Subscribe to Articles


Posted By:Shashi Ray       Posted Date: October 01, 2008    Points: 10    Category: .Net Framework    URL: http://www.dotnetspark.com  


Connections are the starting point to your data access and determine how you connect to the data store. You need to set properties, like ConnectionString, to establish communications to your data store. Here's a brief rundown of connections' key properties and methods.

Key properties

      ConnectionString: (read/write) string used to open a SQL Server database.

            ConnectionTimeout: (read) maximum time allowed for a connection attempt.

      Database: (read) name of the current (or soon to be) connected database.

            DataSource: (read) name of SQL Server instance to connect to.

      ServerVersion: (read) string that identifies the version of the connected SQL Server instance.

          State: (read) current state of the connection.

   Key methods

            BeginTransaction: (overloaded) begins a database transaction.

            ChangeDatabase: changes the current database for an open SqlConnection.

            Close: closes the connection to the database.

            CreateCommand: creates and returns a SqlCommand object associated with the SqlConnection.

            Open: opens a database connection with the property settings specified by the ConnectionString.


 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend