Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all 1447 articles
Browse latest View live

Connector/Net Timeout problem. (1 reply)

$
0
0
We have experience a strange timeout behavor of mysql connector. We are using Connector/Net 6.1.3, and the server is 5.1.41 on ubuntu 10.04 LTS.

When we issue a query that return large volume of records, it will only return some of the records, instead of throw the timeout exception.

We see this on both MySqlDataAdapter and MySqlDataReader using following bare bone code.

using (MySqlConnection con = new MySqlConnection(connectionString))
{
MySqlCommand cmd = con.CreateCommand();
cmd.CommandText = sql;
cmd.CommandTimeout = 10;
MySqlDataAdapter adapter = new MySqlDataAdapter(cmd);
adapter.Fill(ds);

// con.Open();
// MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
// while (reader.Read())
// {
// result.Add(reader.GetString(0));
// }
// reader.Close();
}

Is this a bug in mysql connector?

We tried the mysql connector 6.2.3 and it now throws the exception, however, the time it takes to throw the exception is much longer ( 6 minutes ) than what we set ( 10 seconds) .

Can any shed some light on this? Really appreciate. This has been blocking us for few days already.

Thanks

Michael

Unable to connect to any of the specified MySQL hosts (1 reply)

$
0
0
Hi,

I'm trying to develop a program in C# using connector/.NET that will access a MySQL database remotely, connecting through an SSH tunnel. I've been using the tutorial at http://georgelantz.com/2007/09/10/access-mysql-through-ssh-tunnel-in-a-windows-net-application/ but I am getting the error "Unable to connect to any of the specified MySQL hosts". It's showing an InnerException that says "No connection could be made because the target machine actively refused it 127.0.0.1:3306". I've been using port 3306 which I have had success with using MySQL workbench to connect from this same machine through an SSH tunnel. I'm developing the program on a windows 7 machine. Any help with this would be greatly appreciated.

Try/Catch LOAD DATA INFILE (1 reply)

$
0
0
Hello all. I am trying to catch insert errors for imported *.csv files. with my current code, any rows of data that do not meet the constraints of the table are simply skipped... I would like to throw an exception so I can send the "bad" records to a container on the front end and allow a user to examine and delete/correct the issue and then insert the modified records. Can this be done or should I LOAD DATA INFILE to a constraint-free table then run and insert and catch the errors there?

Imports MySql.Data.MySqlClient
Public Class Form1
    Dim flName As String = "C:\\a1\\DATA\\101 3089.csv"
    Dim var1 As String = "101 3089"


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
                                Handles Button1.Click

        Dim conn As MySqlConnection = New MySqlConnection

        conn.ConnectionString = "server=192.168.0.2;" & _
                                     "user id=root;" & _
                                     "password=**********;" & _
                                     "database=db1"

        Dim com As MySqlCommand = New MySqlCommand

        conn.Open()
        With com
            Try
                .CommandText = "LOAD DATA LOCAL INFILE '" & flName & "' INTO TABLE csvTest" & _
                                  " FIELDS TERMINATED BY ','  LINES TERMINATED BY '\r\n'" & _
                                  " (idcsvTest,bLen,bWid,bMinLen,bMaxLen,bWid1,bWid2,bWid3,bAvgWid) " & _
                                  "SET ticknum='" & var1 & "';"
                .Connection = conn
                .ExecuteNonQuery()

            Catch oops As MySqlException
                MsgBox("MySQl says: " & oops.ErrorCode & "-" & oops.Message)
                'Do catchy stuff...
            End Try

        End With

        conn.Close()
        conn.Dispose()
        conn = Nothing


    End Sub
End Class

If this question should be limited to just the
LOAD DATA INFILE
statement, please let me know and I will ask in the general MySql area instead.
thank you in advance.

Chris

MySQL Connector/Net 6.3.3 has been released (no replies)

$
0
0
MySQL Connector/Net 6.3.3, a new version of the all-managed .NET driver for MySQL has been released. This is a beta release and is intended to introduce you to the new features and enhancements we are planning. This release should not be used in a production environment. It is now available in source and binary form from http://dev.mysql.com/downloads/connector/net/6.3.html] and mirror sites (note that not all mirror sites may be up to date at this point of time - if you can’t find this version on some mirror, please try again later or choose another download site.)

The new features or changes in this release are:

* Visual Studio 2010 RTM support
* New sql editor. Create a new file with a .mysql extension to see it in action
* Please check the changelog and release notes for more information

==== What we know may be broken =====
Documentation is not yet integrated into VS 2010.

Please let us know what else we broke and how we can make it better!

MySql.Web.SessionState run in medium trust produces error (no replies)

$
0
0
All,
I am trying to use the .net connector session state provider in medium trust mode as it is required by my hosting company (GoDaddy) but I get the following configuration error:

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Request for the permission of type 'System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:

Line 63: <providers>
Line 64: <remove name="MySqlSessionStateProvider"/>
Line 65: <add name="MySqlSessionStateProvider" type="MySql.Web.SessionState.MySqlSessionStateStore, MySql.Web, Version=6.3.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="MySqlServer" applicationName="/" />
Line 66: </providers>
Line 67: </sessionState>

This however runs just fine in full trust mode. I have re-created the error with mysql ver. 6.2.3.

The sessionState provider declaration is:
<sessionState cookieless="true" regenerateExpiredSessionId="true" mode="Custom" customProvider="MySqlSessionStateProvider">
<providers>
<remove name="MySqlSessionStateProvider"/>
<add name="MySqlSessionStateProvider" type="MySql.Web.SessionState.MySqlSessionStateStore, MySql.Web, Version=6.3.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="MySqlServer" applicationName="/" />
</providers>
</sessionState>


Would greatly appreciate any help,
Thank you.

===> sell cc all countries good and fresh <=== (no replies)

$
0
0
I have a list cc:
- Us = 2$/1cc
- Uk = 5$/1cc
- Ca = 10$/1cc
- Au = 10$/1cc
- Eu = 15$/1cc
- Mx = 15$/1cc
- Nz = 15$/1cc
- Ve = 15$/1cc
- Fr = 15$/1cc
- Ger = 15$/1cc
- ASIA = 15$/1cc
- Japan = 15$/1cc
- Itali = 15$/1cc
- Spain = 15$/1cc
- Sweden = 15$/1cc
- Denmark = 15$/1cc
- Us Full = 20$/1cc
- Us dob or bin = 10$/1cc
- Uk full = 30$/1cc
- Uk dob or bin = 15$/1cc
- Ca full = 30$/1cc
- Ca dob or bin = 20$/1cc
- Eu full = 40$/1cc
- Eu dob or bin = 30$/1cc
.................................................

- If you purchase CVV multiple quantities we will discount.
- CVV will be emailed to you after payment is received.
- All of my CVV has been tested before sale.
- I assure you my CVV are good.
- I have a replacement policy for CVV death.
- I only accept WU or LR.
- I am looking for people who can work together.
- I am very happy to serve you in a long time, thanks !

Let's contact me:
Y!H : sell_cvv_good_89
Mail: sell_cvv_good_89@yahoo.com

Reasons of "An existing connection was forcibly closed by the remote host" ? (2 replies)

$
0
0
Hello,
Once in a few days I see System.Net.Sockets.SocketException thrown, saying "An existing connection was forcibly closed by the remote host".

I don't understand the reasons for this exception. Our mysql server is not being shutdown at that time, clients and the server are in the same small local network.

So I want to ask the developers - what are the most probable reasons for this exception?

Here is a stack trace from the logs:


Exception type: System.IO.IOException
Exception message: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.

Inner exception type: System.Net.Sockets.SocketException
Inner exception message: An existing connection was forcibly closed by the remote host

Stack trace:
at MyNetworkStream.HandleOrRethrowException(Exception e)
at MyNetworkStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.TimedStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.SendPacket(MySqlPacket packet)
at MySql.Data.MySqlClient.NativeDriver.ExecutePacket(MySqlPacket packetToExecute)
at MySql.Data.MySqlClient.NativeDriver.SendQuery(MySqlPacket queryPacket)
at MySql.Data.MySqlClient.Driver.SendQuery(MySqlPacket p)
at MySql.Data.MySqlClient.Statement.ExecuteNext()
at MySql.Data.MySqlClient.PreparableStatement.ExecuteNext()
at MySql.Data.MySqlClient.PreparableStatement.Execute()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
at RA.WinForms.CreateBoxForm.SaveToDB(MySqlCommand command) in C:\VCProjects\Alex\RA\RA\WinForms\CreateBoxForm.cs:line 236



I tried to search all over the Internet to understand the reason but with no luck.

Get ID after Inserting (2 replies)

$
0
0
Hi,

I'm using the .NET-Connector with C#. I have a question about how to get an auto-incremented primaykey value after inserting data.

Therefore i've got a table like this:
CREATE TABLE `images` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` TEXT NOT NULL,
PRIMARY KEY (`id`),
UNIQUE (`id`)
);

Now i'm inserting a row like this:
command = connection.CreateCommand();
command.CommandText = "INSERT INTO `images` (`id`, `name`) VALUES (NULL, 'test');";
MySqlDataReader result = command.ExecuteReader();

How can i get the newly generated id? (Also in case there are more datasets with name "test".)

regards cm

6.2.3 binary download (1 reply)

$
0
0
Are the 6.2.3 binaries available for download? I can only find the source.

If only the source are available, then I have another question; I cannot build it as it's giving me this error:

Cryptographic failure while signing assembly 'C:\mysql\MySql.Data\Provider\obj\x86\Debug\MySql.Data.dll' -- 'The key container name 'ConnectorNet' does not exist' MySql.Data

FormatException in DotNET Connector - Input string was not in a correct format. (no replies)

$
0
0
I'm working in VB.NET in Visual Studio 2008. My preferred Framework is 3.5 SP1.

I'm working with older MySQL Servers using the DotNET Connector 5.0.8.1. To my understanding, this is the newest possible Connector version to work with the MySQL Servers I'm connecting to.

I have no control over or direct access to the primary MySQL server itself; my login account is read-only with other restrictions and it is administrated by a 3rd party. MySQLConnection.ServerVersion returns the string '4.0.15-log'

I have a secondary MySQL Server which I do have control and direct access to, including root. MySQLConnection.ServerVersion for this one returns the string '5.1.33-community' and the same DotNET Connector is used to connect to it.

Both servers allow me to call MySQLConnection.GetSchema().

The secondary server allows me to call MySQLConnection.GetSchema("Databases") with no problem.

The first server always throws an unhandled FormatException on that same line of code with the text 'Input string was not in a correct format.' Other strings passed through MySQLCommand objects don't have the same problem and attempts to access other Schema Collections fail with access restrictions where appropriate so I don't believe this is a real encoding issue.

I'm at a loss. Anybody able to shed some light on this?

Website MySQL Connection through Firewalls (no replies)

$
0
0
Hi everyone,

I'm trying to establish a connection to a remote MySQL database using C#/.NET. I have my firewalls up, so it is necessary to create a tunnel. I am able to create the tunnel and connect into the remote database on the web server PC, but when I reference the tunnel in my code (I currently have it as localhost:3391), the website is still unable to create the connection. I get the following error:
"Unable to connect to any of the specified MySQL hosts."

Are there special ports to use for source and destination in my tunnel profile when trying to access MySQL through the web? And if so, how do I reference the connection in my code?

Thanks so much,
Laura

Problem with MySqlDataReader (no replies)

$
0
0
Hi all, i'm having a problem with MySqlDataReader and TimeOut.
The problem: i have to read a table in a remote database, the MySqlDataAdapter.ExecuteReader() returns in 2 seconds, ultra-fast. But when i put it in a DataTable throws an exception "IO TIMEOUT".
I test it puting in a DataSet, but the same problem.
(Note: over LAN there is no problem, via Internet is the problem)

Please help me.
Thanks!

Gonzalo.

Edit 2: I'm testing the application and Over Internet the datareader bring me 10969 records, after de timeout.

Unable to connect to any of the specified MySQL hosts (no replies)

$
0
0
Hi everyone

I am developing a windows service using C#, .net 3.5, visual studio 2008 sp1. I am using the .net connector 6.2.2. I am connecting to mysql server 5.1.49-community for Win32. This database server is running on a Windows 2003 enterprise sp2, and the service is place on the windows 2003 server, too.

As I am running a test program to testing con-currency of the windows service, the log file records "Unable to connect to any of the specified MySQL hosts" when executing non-query operations. But it looks right when the service just started and run several few non-query operations.

As I run query "show global status like '%conn%'" in Navicat, it shows:

Aborted_connects 1
Connections 95
Max_used_connections 16
Ssl_client_connects 0
Ssl_connect_renegotiates 0
Ssl_finished_connects 0
Threads_connected 10

I supposed there was something wrong with my MySQL connector. But when I take the windows service to run on Windows 7, and run the testing program again, the error "Unable to connect to any of the specified MySQL hosts" will never happen.

So strange, how could it be?

Thanks!

Why Connector/.NET not support socket layer async? (no replies)

$
0
0
I see MySQL Connector/.NET 6.2.3 source code, it has a method “BeginExecuteReader” support async, but it's have No sense in improving client performance.To such and such.
on windows platform,thread count is very limited,using delegate can't reduce thread cost,cpu still higher and higher


why not use stream.BeginRead BeginWrite to implement async exeute? this mode use iocp threads, the Throughput will be Significantly improved. On the other hand,in a Network instability and high concurrency environment,this will more robust,not make the client crush

SSIS Data Destination task difficulties (no replies)

$
0
0
I'm trying to use SSIS to do ETL for MySQL. I downloaded Connector/Net 6.2.3 to use with MS SSIS 2008.

I started off with the connection and then tried connecting to tables on the data source task in the data flow. The tables came up as "schema"."table" and threw errors. I then backed out of the editor and in properties added the table name to the table property. This then worked.

Next step was to put this data into a backup table, so I created a data destination task. I had the same issues with the data source task, but got the table's hooked up correctly using the above method.

I then ran the package and got an error message:
[Informer_templateconditions_backup [89]] Error: An exception has occurred during data insertion, the message returned from the provider is: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"Environment", "DocumentName", "ConditionID") VALUES (p1, p2, p3), (p1,p2,p3), (' at line 1

I found a blog entry from a guy who works on SSIS. He recommended setting the RetainSameConnection property to True and then adding in a SQL task before the package to change the MySQL session to accept speeach marks (") as quote identifiers. I did both of these things, and I now get a new error:
[Informer_templates_backup [89]] Error: An exception has occurred during data insertion, the message returned from the provider is: There is already an open DataReader associated with this Connection which must be closed first.

I can't find any guidance on this new error that pertains to my situation. Does anybody have any advice on how to overcome this error?

Thanks in advance,
Stephanie

VS2010 and MySql.Data.resources (1 reply)

$
0
0
Hi there,

I've migrated some of my projects using the MySQL .NET connector (6.3.3) to .NET 4 and VS 2010. I created the ADO Entity Model from an existing database, so the connector seems to work fine.

If I want to open a connection to a MySQL server via code, I get an exception telling me that the assembly "MySql.Data.resources" could not be found.

Any ideas?

Thanks in advance,
Andreas Nägeli

EF4 - MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to serialize date/time value (1 reply)

$
0
0
I am using NET/Connector 6.3.3 beta with Visual Studio 2010.
The data model is working and I am able to get data back from the database using the context.

When I execute the following linq query

int timeThreshold = 5;
DateTimeOffset cutoffTime = DateTime.Now.AddMinutes(-timeThreshold);

using (var context = new opusismEntities())
{

var unprocessedMessages = from m in context.messages
where m.createdDate < cutoffTime
select m;

try
{
foreach (var message in unprocessedMessages)
{
int gfff = 5;
}
}
catch (Exception e)
{
string exceptionString = e.InnerException.ToString();
}

}

I see this inner exception:

"MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered during command execution. --->

MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to serialize date/time value.\r\n at

MySql.Data.Types.MySqlDateTime.MySql.Data.Types.IMySqlValue.WriteValue(MySqlPacket packet, Boolean binary, Object

value, Int32 length)\r\n at MySql.Data.MySqlClient.MySqlParameter.Serialize(MySqlPacket packet, Boolean binary,

MySqlConnectionStringBuilder settings)\r\n at

MySql.Data.MySqlClient.Statement.SerializeParameter(MySqlParameterCollection parameters, MySqlPacket packet, String

parmName)\r\n at MySql.Data.MySqlClient.Statement.InternalBindParameters(String sql, MySqlParameterCollection

parameters, MySqlPacket packet)\r\n at MySql.Data.MySqlClient.Statement.BindParameters()\r\n at

MySql.Data.MySqlClient.Statement.Execute()\r\n at MySql.Data.MySqlClient.PreparableStatement.Execute()\r\n at

MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)\r\n at

MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)\r\n at

MySql.Data.Entity.EFMySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)\r\n at

System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)\r\n at

System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior

behavior)"

Am I doing something wrong, or is there an issue with the connector serializing DateType types?

speed issue .net connector (1 reply)

$
0
0
i write desktop app. in vb.net and use mysql .net connector 6.2.2 but my app. work perfect . now i table have 6200 rows. and my app. speed is much slow.
am test my database and query in other way.
can some one tellme what type of drive use "Toad"

plz see and help me what am do ??

http://www.youtube.com/watch?v=Ipggfejz38s

VS2010 - .net Connector for production environments (no replies)

$
0
0
Hi

I work with Visual Studio 2010. What connector should I use for production environments? ODBC 5.1.7 or Net 6.2.3?

When will the .net connector 6.3.x GA released?

Regads Michael

MySqlTransaction with MySqlDataAdapter (1 reply)

$
0
0
I am executing a series of commands within the context of a MySQLTransaction. I also want to use MySQLDataAdapter withing the series of commands but I don't see a way of specifing that it use the transaction object.

Am I mssing somthing?
Viewing all 1447 articles
Browse latest View live