Webhost4life supports several types of databases such as MSSQL, MySQL, Excel, Excel 2007 and Access in asp.net application. If you are creating an asp.net application but having no idea how to connect your database to your web application then please have a look at the DB connection samples below:
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;"
Note: Please replace the following infomation in the sample string with your own database information:
- ODBC Name : The name of ODBC. You created in control panel > database > ODBC
- DB Server : sql3xx.mysite4now.com
- DB Name : mydemodb_12345
- DB ID : mydemoid_12345
- DB Password : mydbpw
You can get the DB infomation in hosting control panel->database->mssql admin section
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;"
Note: Please replace the following information in the sample connection string with your own databasde information:
- DBC Name : The name of ODBC you created in control panel > database > ODBC
- IP Address : mysqlxxx.mysite4now.com
- DB Name : mysqldemo_12345
- DB ID : mysqldemo_12345
- DB Password : mysqlpw
Excel
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=path of excel;Extended Properties=Excel 8.0"
Note: Please replace the path of excel by the actual path of your excel file.example:
d:\member\memberID\myexcel.xls
PS. 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"
Note: Please replace the path of excel by the actual path of your excel 2007 file.
Example : d:\hosting\member\memberID\myexcel2007.xlsx
PS. If you need to write data into your excel database, please grant write permission to the excel file.
Access
Access DB WITHOUT password protection:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=path of access db"
Access DB WITH password protection:
"Provider=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=path of access db;password=password of db"
Note: Please replace path of access db by the actual path of your access DB file
Example : d:\hosting\member\memberID\myAccessDB.mdb
Replace password of db by the database password of your Access database.