How do I connect to my database via .NET?

A website built using .NET can be connected to databases of different types: MySQL, MSSQL, and Access databases. 

You need to use a specific connection string to connect to each database type:

MySQL

  • Driver={MySQL ODBC 5.3 Unicode Driver}; Server=(MySQL hostname); Port=; Option=0; Socket=; Stmt=; Database=(MySQL database name); Uid=(MySQL username); Pwd=(the password for the MySQL user);

MSSQL

A driver need not be specified when connecting to an SQL database:

  • Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;

Access Database

  • Driver={Microsoft Access Driver (*.mdb)};” & _ “DBQ=\\path_to_.mdb_file

As long as the placeholders in the above are replaced with your actual database connection details, it should allow a connection to the database.

  • 0 أعضاء وجدوا هذه المقالة مفيدة
هل كانت المقالة مفيدة ؟

مقالات مشابهة

Do you support ASP.NET?

ASP.NET is available for use on our Windows packages, which is available for Windows Hosting. We...

How can I show detailed ASP errors?

By default, Windows Server hides application errors from your website. You can override this by...

Can I use parent paths in Classic ASP?

ASP Parent Paths are disabled on our platform. As a result, Classic ASP scripts using “../”...

Powered by WHMCompleteSolution