________________________________________
Microsoft SQL Server .NET Data Provider (System.Data.SqlClient)
____________________________________________________________________The Microsoft SQL Server .NET Data Provide allows you to connect to a Microsoft SQL Server 7.0, 2000, and 2005 databases.
For Microsoft SQL Server 6.5 or earlier, use the OLE DB .NET Data Provider with the SQL Server OLE DB Provider (SQLOLEDB).
Using C#:
using System.Data.SqlClient;
...
SqlConnection oSQLConn = new SqlConnection();
oSQLConn.ConnectionString =
"Data Source=(local);" + "Initial Catalog=myDatabaseName;" + "Integrated Security=SSPI";//Or
// "Server=(local);" +
// "Database=myDatabaseName;" + // "Trusted_Connection=Yes";oSQLConn.Open();
...
oSQLConn.Close();
// If you open the connection, then close the connection!
// Otherwise the connection does not go back into the connection pool.
// Note the SqlDataAdapter will open and close the connection for you
// when calling it's Fill or Update methods. However if the connection
// is already open, the SqlDataAdapter will leave it open.____________________________________________________________________
Note:If You have need demo then contact with me.Post your request as a comment.
____________________________________________________________________
No comments:
Post a Comment