VS.Net - Connecting to a mySQL databse

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.



Go Back   Webforumz.com > Main Forums > Program Your Website > ASP.NET Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 25th, 2004, 03:17
Tim356's Avatar
Reputable Member
Join Date: Nov 2003
Location: Australia
Age: 25
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Tim356
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 (permalink)  
Old Jul 25th, 2004, 04:27
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)  
Old Jul 25th, 2004, 05:22
Tim356's Avatar
Reputable Member
Join Date: Nov 2003
Location: Australia
Age: 25
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Tim356
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 (permalink)  
Old Jul 25th, 2004, 07:05
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Hmm, not personally. I use SQLServer mostly, though I have run mySQL on my Win machine. Someone else might know more...
  #5 (permalink)  
Old Jul 25th, 2004, 07:27
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)  
Old Jul 25th, 2004, 07:50
Tim356's Avatar
Reputable Member
Join Date: Nov 2003
Location: Australia
Age: 25
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Tim356
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 (permalink)  
Old Jul 25th, 2004, 09:22
Tim356's Avatar
Reputable Member
Join Date: Nov 2003
Location: Australia
Age: 25
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Tim356
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 (permalink)  
Old Jul 27th, 2004, 15:27
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
did you fix this Tim?

Maybe this will help?:
http://aspnet101.com/aspnet101/tutorials.aspx?id=39 (Using MySQL in ASP.Net)
  #9 (permalink)  
Old Jul 30th, 2004, 03:33
Tim356's Avatar
Reputable Member
Join Date: Nov 2003
Location: Australia
Age: 25
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Tim356
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!
Closed Thread

Tags
vsnet, connecting, mysql, databse

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 22:47.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43