Error using mySQL connector/Net


I had a project i was using Devart.Data.MySQL to connect to my mysql databases, however it was aparently a trial version and has expired.  I want to switch over to use connector/Net so i went to the site downloaded v6.0, installed it, and went to bin folder/add reference, went to the assembly, added and i says when i run it:

'MySqlCommand' is not defined.

if i click on the error it suggests "import data.mysql.mysqlclient" however if i do that, it then gives the error

'MySqlCommand' is ambiguous in the namespace 'MySql.Data.MySqlClient'

here is my code


Public Function GetData(ByVal cmd As MySqlCommand) As DataTable

'opens a connection to the database

Dim dt As New DataTable

Dim strConnString As String = "Server=;Database=;Uid=;Pwd="

Dim con As New MySqlConnection(strConnString)Dim sda As New MySqlDataAdapter

cmd.CommandType = CommandType.Text

cmd.Connection = con




sda.SelectCommand = cmd


Return dtCatch ex As Exception


Return Nothing





End Try


"with every fix comes a new bug"
4/26/2009 1:23:32 PM 1929 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 26

When you ask a question, remember to click "Mark As Answer" when you get a reply which answers your question.
4/26/2009 2:32:24 PM

Similar Artilces:

Currently have a site coded in PHP but the customer wants to go to .NET. Can I use the existing MySQL DB or am I required to use MSSQL? Thanks, Ken Check out this forum which is specialized for this kind of questions: ASP.NET MySQL forumBart De Smet [MVP] Visit,

System.Net.Sockets.SocketException with MySQL Connector.NET
Hi. I already tried many things and spent already 2 days without any success. Please help or I'll hang myself.I am using MySql.Data.dll  ver. (runtime v2.0.50727) from my project (library). It works great if i use it from WindowsApplication but once i use it same way in WebApplication, it keeps throwing: The attempted operation is not supported for the type of object referencedException Details: System.Net.Sockets.SocketException: The attempted operation is not supported for the type of object referenced .. AsyncResult ias = socket.BeginConnect(endPoint, null, null);.. (or w...

How to use MySql Connector from toolbox within VS.NET?
Hi, I installed MySql Connector using the msi installer. Next i did Add/Remove in the toolbox of VS.NET and located the appropiate dll and added the connection, command and adapter object. Whenever i try to use the connection object (by dragging it to the aspx form), i get an error in the connectionstring saying "object not set to an instance of an object". Also i can not map a connection key from the webconfig within the visual designer. Dragging command object to the form won't be recognised by intellisense. How can i use the MySql Connector object in the same way i use the...

Sending SMS using or using or
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

Which mySql connector for which .NET version
Hi all,I couldn't find out which connectors target which .net versions. I have tried but could not see which are meant to target which .NET versions.Thanks for your time. guess this connector is backward compatible too, like the Oracle's.. So you may not have any issues Kumar Reddi As I understand it, you have the following: 5.2 is intended for VS 2008/.NET 3.5 5.1 is intended for VS 2005/.NET 2.0 as well as the Compact Framework 2.0 5.0 is unclear though it is appare...

MySQL .Net Connector / PermissionState
HiI have written a WindowsControlLibrary that needs to connect to MySQL from an aspx page. I need a way to write the following code with the mysql-connector-net-5.1.3new System.Data.SqlClient.SqlClientPermission (PermissionState.Unrestricted).Assert();SqlConnection MSconn = new SqlConnection(MSSQLConn); MSconn.Open();//Do my insert. System.Data.SqlClient.SqlClientPermission.RevertAssert();  The MySql driver does not seem to have the Permissions........ It does have a MyClientFactory  Members which has a CreatePermission method I am just not sure how to work with it.  Any ...

ADO.NET MySql Connector
I am having an issue with parameterized queries. I am using the .NET connector. Dim connStr As String connStr = "server=localhost;user id=root; password=pwd; database=test; pooling=false" Dim conn As New MySqlConnection(connStr) Dim command As New MySqlCommand("INSERT INTO pictures(name,filename) VALUES (@name,@filename)", conn) command.Parameters.Add("@name", txtName.Text) command.Parameters.Add("@filename", txtFilename.Text) conn.Open() command.ExecuteNonQuery() ...

MySql Connector .NET and the DbProviderFactory
Hi there... I have downloaded the MySql Connector .NET form . My connectionstring uses the MySql.Data.MySqlClient provider. When i use the DbProviderFactiry to create connections, readers and so on, it comes up with and error, saying that the provider has not been installed proberly... What is the proper way? If i don't use the DbProviderFactiry, and use the MySql Connector .NET like this:             MySqlDataReader reader = null;             try  &n...

error-logon failed to mysql through .net
hi,friend i have some problems with crystal and mysql i create one database app. with report using  mysql as database. when i create report at design time i choose "ODBC(RDO)" for connection and select table and design report  named "crrpt.rpt". than i drag one report viewer in web form and set 'report source' property to path of report file. when i run this project i got this error ---------------------------------------------------------------   Server Error in '/asptest/rpt' Application. ---------------------------------------------------------------------...

mysql and .net
Hi there, i am new to .net and i am trying to setup a simple form. I am an open source person and what i am asking can be done easily using php and mysql; but i need to know how to do this in .net project asap. i have three forms; form1 submit to the database and redirect to form2 and form2 submit to the database and redirect to form3. i want to grab mysql last inserted id from form1 to form2 while redirecting and pass it via the url. i am able to select from the database, but i don't know how to assign it to a variable; here is what i have so far: str2 = "select last_ins...

MySql connector problem
My host doesn't offer SqlServer, so I'm taking a swing at MySql and so far I'm getting a FileNotFoundException in my app when I try to instantiate a MySqlConnection object. I have added a reference to the dll and including the namespace in my using directive. Here is the stack trace: [FileNotFoundException: The system cannot find the file specified.] [FileNotFoundException: File or assembly name 'MySql.Data, Version=, Culture=neutral, PublicKeyToken=c5687fc88969c44d', or one of its dependencies, was not found.]    TheHudsonDrags.Back...

mysql connector .net terminate my database
hi recently i have started using mysql connector .net 5.0.5 for my application, when i testing the application at my localhost it's work fine. but when i upload to the server the system have terminate my database after i review my application.below is the error i get Exception of type 'System.Exception' was thrown.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Exception: Exception of type 'System.Exception' was thrown....

MySql .NET Connector Parameter Problem
I am trying to insert data into a MySql Database on the local machine. I first recieved the error of "Column 'content_type' cannot be null." I changed the parameter in the SQL from "@content_type" to "?". Now I am getting the error message of "Parameter '?' is not defined." I am adding the parameter to the parameters collection of the MySqlCommand, but apparently it isn't getting added. Here is a portion of the code:strSql="insert into images(content_type) values(?);";sqlCmd=new MySqlCommand(strSql,sqlCnn);sqlCmd.Parameters.Add(new MySqlParameter("@content_type","jpeg"));I searched the forum...

------=_NextPart_000_0026_01C30A6E.486AE070 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Anyone run into this problem=20 $mysql->query(q{ INSERT INTO dbname (table_name) VALUES ( $var ) }); The problem is, when I assign a value to a $var that value is ignored in = the SQL statement. Ive tried every operator I know to get it to look at = it and accept the value as input into the DB. Ive tried=20 ( '$var' ) ("$var") ("\$var") ([$var]) ({$var}) Any ideas ? Kind regards...

Web resources about - Error using mySQL connector/Net -

Connector - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Logitech unveils CREATE Keyboard for iPad Pro, available in November w/ Smart Connector support
... that CREATE works seamlessly with all of the unique features of the iPad Pro. For one, CREATE is powered by the iPad Pro via its Smart Connector, ...

Apple's iPad Pro Smart Connector open to accessory makers, Logitech Create keyboard coming in Nov.
Aside from its larger 12.9-inch Retina display, the biggest external design change on the iPad Pro is a new port dubbed the Smart Connector. ...

Beats Pill+ is an elegant Bluetooth speaker with Apple Lightning connector
... mind it, but many accessories, such as mobile keyboards and speakers, charge with micro USB. it would be nice if more things used Apple's connector. ...

Barclays wants to be the 'connector' for bitcoin and is doing a load of experiments with the technology ...
... they’re protecting UK citizens are putting the right regulation around it." Ultimately, White says, Barclays is "seeking to become the connector ...

Orlando-To-Miami Train Moves Forward As Potential Connector Between Central & South Florida
An Orlando-to-Miami train, the potential passenger rail connector between Central Florida and South Florida, has just passed another crucial ...

Fund This: Znaps adds MagSafe-style connector to your phone for $9
... answer to many a MagSafe-lover's prayer. One thing I've long admired about MacBooks: Apple's super-cool, super-logical MagSafe, the power connector ...

Taiwan connector maker JPC enjoying strong orders from Amazon for Dash Button
Taiwan-based connector maker Jess-Link Products (JPC) is seeing growing orders from Amazon for the assembly of its Dash Button and revenues contribution ...

A Day In Harlem With TV Personality And People Connector Bevy Smith
Harlem's biggest advocate schools us on the neighborhood's historic greatness. While most who know her would describe Bevy Smith as a woman ...

In India's Disorganized Agricultural Sector, A Connector Of Crops To Markets
With as many seasons and climates as can be found anywhere around the world, India’s soil has the ability to grow just about anything. Yet farmers ...

Resources last updated: 12/24/2015 3:06:52 AM