This is a discussion on "VS.Net - Connecting to a mySQL databse" within the ASP.NET Forum section. This forum, and the thread "VS.Net - Connecting to a mySQL databse are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
VS.Net - Connecting to a mySQL databse
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
||||
|
||||
|
VS.Net - Connecting to a mySQL databse
In my self tutoring, I would like to learn about C#'s methods of connecting to a mySQL database.
I have mySQL installed and running on my machine, I have used it before with some php scripts, so it's working fine. Can someone please explain the process of connecting to one of my mySQL databases using VS.net? I've had a quick attempt at adding a connection to server explorer, but for some reason I can't connect to the mySQL server. Any help would be really appreciated. |
|
|
|
#2
|
|||
|
|||
|
Assuming you've got the 1.1 version and not 1.0, you'd use the ODBC .NET Data Provider.
using System.Data.Odbc; For details and examples go to http://dev.mysql.com/tech-resources/articles/dotnet/ |
|
#3
|
||||
|
||||
|
thanks Catalyst, I've read that link and found it very helpful, though I am still confused.
I ran winmysqladmin and under where it says server details, it's all blank?? Obviously I haven't set it up properly? But I can still access my databases using (as I said before) php scripts that I had been playing around with earlier. Also, under MyODBC it says, NOT FOUND. Obviously my problem is with the setup I have for mySQL, but I hardly know anything about it. Do you have any ideas what I might have done wrong? |
|
#4
|
|||
|
|||
|
Hmm, not personally. I use SQLServer mostly, though I have run mySQL on my Win machine. Someone else might know more...
|
|
#5
|
|||
|
|||
|
MySQL is pretty easy to setup... you install it and set the configuration file... and that's is, lol. It just works.
http://dev.mysql.com/doc/mysql/en/Wi...tallation.html |
|
#6
|
||||
|
||||
|
That's what I thought, but obviously I've done something wrong. I might try uninstalling and reinstalling, and pay more attention to the settings.
But why would I be able to access with everything but Visual Studio? Maybe I'm not setting it up right in VS? I right click on Data Connections, ->Add connection -> use "Dell" as my sql server (that's what localhost is), fill in username and password, then when I select the drop down menu for database, I get an error - SQL server does not exist or access denied. But I'm using the same settings I use for everything else that access my SQL databases??? I'm tearing my hair out.... |
|
#7
|
||||
|
||||
|
OK, reinstalled mySQL and now I have all the server details showing up in the mysqladmin thing, but still no love from Visual Studio.
I give up - I'll ask one of the developers at work tomorrow. |
|
#8
|
|||
|
|||
|
did you fix this Tim?
Maybe this will help?: http://aspnet101.com/aspnet101/tutorials.aspx?id=39 (Using MySQL in ASP.Net) |
|
#9
|
||||
|
||||
|
I spoke to one of the developers and he just recommended hard coding the database details instead of using the server explorer - he said that he has never used the server explorer for sql databases before. But I will check out your link Smokie, I appreciate your help!
|
![]() |
| Tags |
| vsnet, connecting, mysql, databse |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Connecting/Using MySQL and ASP | Monie | Classic ASP | 8 | Oct 12th, 2007 09:00 |
| problem connecting to mysql from dreamweaver | steven rowlands | PHP Forum | 6 | Mar 18th, 2007 09:11 |
| databse problem | summaiya | ASP.NET Forum | 2 | May 10th, 2006 10:16 |
| Shopping cart to a databse. | twinuno | Classic ASP | 2 | Nov 25th, 2005 22:58 |
| Checkbox + databse | rafi | Classic ASP | 4 | Aug 4th, 2005 08:02 |