revosoft
07-21-2004, 03:30 PM
How can i connect to a mySQL database using a Visual Basic .Net program and is it a good idea for a easy to use client database?
![]() | View Full Version : mySQL & VB.net revosoft 07-21-2004, 03:30 PM How can i connect to a mySQL database using a Visual Basic .Net program and is it a good idea for a easy to use client database? MaJiD SaeeD Khan 07-28-2004, 07:58 AM There are so many methods to connect to MySQL from .net environment. If you ask for an easy way out then i refer you blueshell Active Tables. http://www.pcworlddownload.com/development-tools/database/blueshell-Active-Tables.htm But if you are a good programmer and you really want to do it on your own way, then there are three ways to connect to MySQL as mentioned by MySQL themselves. - The ODBC.NET Solution - MyODBC Driver - Using MySQL Native .NET Providers - Using the OLEDB.NET Solution - MyOLDDB Provider http://dev.mysql.com/tech-resources/articles/dotnet/ I hope this will help you, but if you still need some guidance.. just let me know. SEATi 08-16-2004, 05:21 AM I would suggest using the MyODBC driver, as it handles connections better (at least that's what I think). EngLee 06-24-2005, 05:00 PM I agree with him. Here's what I did to connect... lifeasprogrammer.blogspot.com/2005/06/visual-basic-net-and-mysql-connection.html Ricardob 06-26-2005, 11:16 PM I haven't tried to connect to mysql from a .net application, but pretty much your options are: Basically ado.net gives you 3 ways to connect to datasources. 1) using an odbc provider, .net provides wrapper classes for odbc providers, if you have the mysql odbc driver installed, these classes should recognize. This method is NOT recommended by Microsoft since it's a lot slower and may present a security threat. 2) using a generic oledb provider, because mysql is oledb compatible it should work, but you will have to find out what the connection string should be (probably on the mysql site). 3) Using a specific provider. Microsoft provides specific providers for SQL Server and Oracle. Oracle slaso has its own data provider for .net, it's possible that MySql or someone else has developed an specific provider that would be more efficient than generic ones. The nice thing is that whatever method you choose, the data access classes are pretty much the same, same properties, same methods, they all have datareader, command, datadapter, etc. There might be some methods that are only available to specific providers (mostly more database specific) but for general tasks the logic is the same. A component that access a SQL Server database can access a Mysql one just changing the connection strings (providing you are using the generic oledb provider), even if you are using an specific provider, you only need to change the names of some classes and recompile. Of course this has its limitations and you should be aware of what the database can do and what it can't do, and also be familiar with the specific syntax for certain things, for example, the sql language is pretty much standard for all databases, but if you use parameters, and/or stored procedures, or triggers, then the syntax can be very different. SEATi 06-26-2005, 11:40 PM It's been almost a year since the original thread was started, is it really worth it to bring it alive again? |