Asp.net connection mssql mysql access Excel 2007 database

Source: Internet
Author: User

Asp tutorial. net connection mssql mysql tutorial access excel 2007 database tutorial

This article has added an asp.net tutorial to connect to the mssql mysql access excel 2007 database. The following is a good classification. Just copy it and change the connection file address to your address.
Mssql

Asp.net connection

"Server = db server; database = db name; uid = db id; pwd = db password;" providername = "system. data. sqlclient" ole db connection string (dsnless connection ):
"Provider = sqloledb; data source = db server; user id = db id; password = db password; initial catalog = db name ;"
Odbc connection string

"Dsn = odbc name; user id = db id; password = db password; initial catalog = db name ;"

Pleasereplace is in red to your database information. If youdon't knows the database information, you can see this article.
For example:
Odbc name: the name of the odbc you created is in the Control Panel> "database"> odbc
Database server: sql3xx.mysite4now.com
Db name: mydemodb_12345
Database id: mydemoid_12345
Database password: mydemopw


Mysql

Ole db connection string (dsnless connection ):

"Driver = {mysql}; server = db server; database = db name; user = db id; password = db password; option = 3 ;"

Odbc connection string (requires a odbc to be created first ):

"Dsn = odbc name; user = db id; password = db password; database = db name ;"

Pleasereplace is in red to your database information.
For example:
Odbc name: the name of the odbc you created is in the Control Panel> "database"> odbc
IP address: mysqlxxx.mysite4now.com
Db name: mysqldemo_12345
Database id: mysqldemo_12345
Database password: mysqlpw

 

Excel

"Provider = microsoft. jet. oledb.4.0; data source = path of excel; extended properties = excel 8.0 & prime;

Replace your database connection file
Example: d: www.111cn.netmembermemberidmyexcel.xls

Pstutorial. if you need to write data into your excel database, please grant write permission to the excel file.

Excel 2007

"Provider = microsoft. ace. oledb.12.0; data source = path of excel; extended properties = excel 12.0 & prime;

Replace your data connection address
Example: d: hostingmemberwww.111cn.netmyexcel2007.xlsx

If you want to write data to an excel database, grant the write permission to an excel file.

Access

For access db without password protection:

"Provider = microsoft. jet. oledb.4.0; data source = path of access db"

For access db with password protection:

"Provider = msdasql; driver = {microsoft access driver (*. mdb)}; dbq = path of access db; password = password of db"

Replace your database connection address
Example: d: hostinghttp: // mb.111cn. netmemberidmyaccessdb. mdb

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.