Hi, I am getting very very annoyed trying to find the refrence for MySqlConnection. I am trying to connect to my database, but everytime I use MySqlConnection I getting the following error:
The type or namespace name 'MySqlConnection' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\NAME\Local Settings\Application Data\Temporary Projects\WindowsFormsApplication1\Form1.cs 25 13 WindowsFormsApplication1
Yes I know that I am missing a refrence but I honestly have NO CLUE what I ned to correct this error. Thanks for any help.
Loading
Shahan AyyubPosted Dec 20, 2010, 5:44 PM
I should have consider your seniority and respect your opinion. I will take care of this from next time.
Thanks.
Sam HobbsPosted Dec 20, 2010, 4:32 PM
Shahan AyyubPosted Dec 20, 2010, 8:52 AM
no problem. My aim is not to hurt you. we are the part of same platform.
Sam HobbsPosted Dec 19, 2010, 8:56 PM
In your first message, you said to use "using System.Data.SqlClient;", correct? That sure looked incorrect to me.
In your second message, you said to use SqlConnection instead of MySqlConnection, correct? If my understanding is incorrect, then I apoloigize for misunderstanding.
Shahan AyyubPosted Dec 19, 2010, 6:26 PM
I said this:
>>>there is no MySqlConnection class that MSDN and .Net offers
In a sense that I was guiding @Steve for "Add Reference" so if its a 3rd party .dll it will be available to him only(which he didn't declare yet) not comes with .net library.
Shahan AyyubPosted Dec 19, 2010, 6:21 PM
I have already posted the same link if you have been read my comment carefully and I have provided the solution for that also.
Sam HobbsPosted Dec 19, 2010, 6:12 PM
http://www.bing.com/search?q=MySqlConnection&go=&form=QBLH&qs=n&sk=&sc=6-15
Some of the results of that are:
Note that you might need to download the relevant library to get the MySqlConnection class and related software.
Sam HobbsPosted Dec 19, 2010, 5:40 PM
Shahan AyyubPosted Dec 19, 2010, 2:34 PM
If you have used some other assembly like this one:
http://www.devart.com/dotconnect/mysql/docs/Devart.Data.MySql~Devart.Data.MySql.MySqlConnection_members.html
then
"Add Reference" from "Solution Explorer" and then add refernece of Devart.Data.MySql.dll
then in code/Form1.cs
right Click on the word "MySqlConnection", in the menu find Resolve and click on the first item.(if casing of MySqlConnection will be correct you will get item)
I hope it will help you.
Shahan AyyubPosted Dec 19, 2010, 2:19 PM
Are you sure you have this line at start of "Form1.cs"
using System.Data.SqlClient;
Gomathi PalaniswamyPosted Aug 6, 2010, 4:11 AM
First create the folder with in your application and give the sqlconnection like
sqlconnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFileName="+Application.StartupPath.Remove(Application.StartupPath.Length-10,10)+@"\db\PAM.mdf;Integrated Security=True;User Instance=True");
by the above maintain the database any where