Database connection in .cs file
Hi
I am a beginner in .net.
I am now trying to do a sample project - Windows application.
I am trying to connect to a database MySQL.I am having two files - Login.aspx and Connection.cs
I want the database connection code in .cs file and need to call this .cs file in .aspx page.
I have added the reference of mysql.
The class file contains :
The declared string,connectionstring
I have also declared mySqlConnection and i used the connectionstring as a parameter in sqlConnection.
string connString = "Data Source=(local);Initial Catalog=abcd;Uid=abcd;Password=nhjk";
MySqlConnection connect = new MySqlConnection(connString);
and then when i proceed further like connect.open() or connect.CreateCommand() , the intellisense is not poping up and is throwing error.
Can anyone pleasehelp me in ths regd.
Thanks
Re: Database connection in .cs file
What is the error you get?
Did you reference the MySql.Data.dll into to your project's references?