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

No route to host when connect to mysql in Fedora 15 (1 reply)

$
0
0
Hi,

When I try to connect to the Mysql database through the Apache on Fedora 15, it display the error:

Server Error in '/' Application

No route to host

Description: HTTP 500. Error processing request.

Stack Trace:

System.Net.Sockets.SocketException: No route to host
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket+Worker.Connect () [0x00000] in <filename unknown>:0

I have disabled the firewall and can connect to the mysql using command: mysql -u root -h 192.168.0.1 -p; However, when I try to connect to Mysql database through website, it display the error No route to host.

Please advice, thank you so much.

Error on Generate Database from Model (4 replies)

$
0
0
I am using Microsoft Visual Studio 2012 Version 11.0.50727.1 RTMREL
with Microsoft .NET Framework 4.5.50709 with Entity Framework version 5.0.0.0
with Oracle MySQL Connector 6.7.4.0 with runtime version 4.0.30319

I have 3 entities (tables) inside of a .edmx (Entity) model with many scalar properties and an association between the entities.

Upon using the context menu (via right click) in an attempt to "Generate Database from Model" I receive a rather long error message, which is at the bottom of the post.

In my entity model, I have added the reference "MySql.Data.Entity" and changed the DDL Generation Template to "SSDLToMySQL.tt (VS)," as per the documentation for the MySQL Connector Net. The model is a "ConceptualEntityModel" currently, but the same error occurs if no type is chosen (the default).

Checking the error list also shows a warning: "Compiling transformation: Comparison to integral constant is useless; the constant is outside the range of type 'int' c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\GenerateMySQL.Utility.ttinclude 77 45 "


The actual error being thrown is:

Error 2 Running transformation: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.TextTemplatingEC7AD8F9FBE0E4583F2618228C4182E3CCEE1C700F320D1F98B9908646EAFA8024A750223ACC9C5A71B36A0AEE5FD12A02298E7F752E89E2BAE365DAC8A8BB03.GeneratedTextTransformation.GetProviderManifestToken(String edmxPath) in c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\GenerateMySQL.Utility.ttinclude:line 142
at Microsoft.VisualStudio.TextTemplatingEC7AD8F9FBE0E4583F2618228C4182E3CCEE1C700F320D1F98B9908646EAFA8024A750223ACC9C5A71B36A0AEE5FD12A02298E7F752E89E2BAE365DAC8A8BB03.GeneratedTextTransformation.TransformText() in c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\SSDLToMySQL.tt:line 121 c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\GenerateMySQL.Utility.ttinclude 142 1



Thank you
-Kyle

Connector 6.7.4 Cluster Connection Fails (1 reply)

$
0
0
I have a Percona Multi-Master cluster I am trying to connect to.

These connection strings each work just fine to the individual servers:
string myDBCS = "Server=192.168.100.220;Uid=myuser;Pwd=password;Database=testdb;port=3306;";
string myDBCS = "Server=192.168.100.221;Uid=myuser;Pwd=password;Database=testdb;port=3306;";
string myDBCS = "Server=192.168.100.221;Uid=myuser;Pwd=password;Database=testdb;port=3306;";

But this fails with an "Unable to connect to any of the specified MySQL hosts.".
string myDBCS = "Server=192.168.100.220, 192.168.100.221, 192.168.100.222;Uid=myuser;Pwd=password;Database=testdb;port=3306;";

Any I missing something?

Larry

Affected rows by ExecuteNonQuery() (2 replies)

$
0
0
I use this code for queries of type insert, update and delete as stated in http://dev.mysql.com/doc/refman/5.5/en/connector-net-tutorials-intro.html:

- ExecuteReader - used to query the database. Results are usually returned in a
MySqlDataReader object, created by ExecuteReader.
- ExecuteNonQuery - used to insert and delete data.
- ExecuteScalar - used to return a single value.

Code:

MySqlCommand cmd = new MySqlCommand(sqlstatement, connection);

for (int i = 0; i < parameters.Length; i++)
  cmd.Parameters.AddWithValue("@" + i.ToString(), parameters);
              
int affectedRows = cmd.ExecuteNonQuery();

lastInsertID = Convert.ToInt32(cmd.LastInsertedId);

I have not found documentation for method ExecuteNonQuery which says that it returns number of affected rows by update, delete or insert query.

Documentation (http://dev.mysql.com/doc/refman/5.5/en/connector-net-ref-mysqlclient.html#connector-net-ref-mysqlclient-mysqlhelper-executenonquery-overloads) for ExecuteNonQuery (overloaded) says only this:

public static int ExecuteNonQuery(MySqlConnectionconnection,
string commandText,
params MySqlParameter[]commandParameters);


Where can I verify that ExecuteNonQuery() returns number of affected rows in documentation. I tested and ExecuteNonQuery() does return number of affected rows, but I would like see description of return value in documentation.

There is RecordsAffected property but it is available by MySQLDataReader class. Is it better to execute insert, update and delete statement using ExecuteReader() method.

MySQL Connector/Net 6.8.0 alpha has been released (no replies)

$
0
0
Dear MySQL users,

MySQL Connector/Net 6.8.0, a new version of the all-managed .NET driver for MySQL has been released. This is an alpha release for 6.8.x and it's not recommended for production environments.
It is appropriate for use with MySQL server versions 5.0-5.6

It is now available in source and binary form from http://dev.mysql.com/downloads/connector/net/#downloads and mirror sites (note that not all mirror sites may be up to date at this point-if you can't find this version on some mirror, please try again later or choose another download site.)

The 6.8.0 version of MySQL Connector/Net has support for Entity Framework 6.0 including:

- Async Query and Save
- Code-Based Configuration
- Dependency Resolution
- DbSet.AddRange/RemoveRange
- Code First Mapping to Insert/Update/Delete Stored Procedures
- Configurable Migrations History Table
- DbContext can now be created with a DbConnection that is already opened
- Custom Code First Conventions



The release is available to download at http://dev.mysql.com/downloads/connector/net/#downloads


Documentation
-------------------------------------
You can view current Connector/Net documentation at http://dev.mysql.com/doc/refman/5.6/en/connector-net.html


You can find our team blog at http://blogs.oracle.com/MySQLOnWindows
You can also post questions on our forums at http://forums.mysql.com/

Enjoy and thanks for the support!

Connector/NET Team

Cluster Connections (1 reply)

$
0
0
Hello.

I am now using .net connector 6.6.6.0 to do a connection to a multi-master cluster. And it works quite well. So if my connection string has "Server=192.168.1.1,192.168.1.2,192.168.1.3;...", what is the logic used to decide which server is connected to first. Does it just start with the first one and see if it is available and if not try the next one? Maybe randon among the three?

Thanks.

Larry

Question on deploying apps that use the Connector (1 reply)

$
0
0
When I deploy an application that utilizes the connector (I'm writing a Visual C# app), do I have to manually install the MySQL Connector on the target machine, or is there a way that I can "bundle" the required modules and my app together into an installer package that will automatically install the connector?

I'm using VS 2012 Pro.

SSIS Mapping Files (1 reply)

$
0
0
All, My machine does *NOT* have these file and its causing issues trying to use SSIS to integrate....

MySQLToMSSql10.xml
MySQLToSSIS10.xml
MSSQLToMySQL.xml
SSISToMySQL.xml
The default location of these files is

\Program Files\Microsoft SQL Server\110\DTS\MappingFiles\ or 110 if you use sql server 2008

Where can i find these? I urgently need them

keeping Mysql connection live between function calls (2 replies)

$
0
0
I have created a database" wrapper" class to assist me in using the MySql connector interface. Anyway, I created and OpenConn() and CloseConn() function which has error checking built in to the functions so I don't have to manually write this each time I want to connect or close a connection.

My question is how can I keep the connection open between function calls? (because it seems as if when each function/method ends, the connection is closed. )

Run MySQL on database located on another computer/resource (2 replies)

$
0
0
Is it possible to run a MySQL instance from my machine with the software on my computer but have the database location on a different computer?

eg. mysql program on my local Windows machine but the database is on the s: drive which is available through the network - could be a NAS drive or another computer drive resource that does not have the MySQL software running directly on it.

.NET connector 32 bit only ? (2 replies)

$
0
0
Hi, I am new in MySql. I download .NET connector 6.7.4 x86/32 bit but can not find x64. I try to connect MySql x64 server works fine.

My question is MySql only provides .NET connector 32bit to connect both 32 bit and 64 bit ?

Can't connect from C# using MySqlConnection (2 replies)

$
0
0
Hi everyone,
I am trying to write a program in C# that elaborates some data and then puts it in a remote database.
I have been trying all sort of different things and finally managed to make the following code work.


string connStr = "server=localhost;user=username;database=dbname;port=3306;password=passwd;";

MySqlConnection conn = new MySqlConnection(connStr);
bool connected = false;
try
{
Console.WriteLine("Connecting to MySQL...");
conn.Open();
connected = true;
// Perform database operations
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
if (connected)
MessageBox.Show("WOWOWOWOWO it's working!!!!!!!!!");
else
MessageBox.Show(":'(");
conn.Close();

As you probably noticed I said that I want to connect to a remote DB and in the connection string I've put localhost.
This is my problem, if I connect to a local database everything works fine, when I try to connect to the remote one it never works.
I've thought about all the server-side problems i could think of:
- remote access not allowed (but I have other software that use that DB and it works fine with it)
- only certain IPs could access the DB (but again other software can access from any IP)

So I'm asking if any of you could give me a hand and point out what I've missed/did wrong

Thanks for your time,
Cristian

Persistant connections? (1 reply)

$
0
0
I'm writing a desktop application that will be using the MySQL Connector for .Net.

I'm wondering if it is better to have one connection that is openend when the app starts, and then closed when the app terminates, or should i have each method (Function) open and close the connection (basically being opened to perform one action, and then closed again).

What's the best way to go about this. My application both reads and writes to the database.

(Additional information: this is an order tracking system)

Connector/Net 6.8.0 alpha - Installation problem (2 replies)

$
0
0
Not sure if it's just something odd about my dev environment, but I cannot get the installer for Connector/Net 6.8.0 alpha to run. I keep getting this error:

"There is a MySql Visual Studio Plugin version installed, you need to install Connector/Net 6.7 or higher version to work with. Please uninstall MySql Visual Studio Plugin or install Connector/Net 6.7 or higher."

I get the same error regardless of whether I have installed or uninstalled the Visual Studio plugin. I've even tried uninstalling all MySql tools, and still get the same error. I have both the 2010 and 2012 versions of Visual Studio, but neither show any Connector/Net version as an entension after a full uninstall, so I don't entirely get what the 6.8.0 installer is looking at...

Am I missing something obvious?

Cant Uninstall MySQL Connector 6.7.4 on windows 7 (1 reply)

$
0
0
HI,

is there anyone who can help me? i install MySQL 6.7.4 connector..
then i received some error like cant connect to local host.. i try to seek out some solution until i decided to uninstall my MySQL and re install it.. but then i my mysql connector cant be uninstall .. it always says it ended prematurely .. i tried it via control panel and no luck ..


i cant install my mysql without uninstalling that connector

i dont know what to do >______<
and i need this sql ASAP for my thesis

is there someone who can help please.. thanks

MySQL Connector/Net 6.8.1 beta has been released (no replies)

$
0
0
Dear MySQL users,

MySQL Connector/Net 6.8.1, a new version of the all-managed .NET driver for MySQL has been released. This is a beta release for 6.8.x and it's not recommended for production environments.
It is appropriate for use with MySQL server versions 5.0-5.6

It is now available in source and binary form from http://dev.mysql.com/downloads/connector/net/#downloads and mirror sites (note that not all mirror sites may be up to date at this point-if you can't find this version on some mirror, please try again later or choose another download site.)

The 6.8.1 version of MySQL Connector/Net has support for Entity Framework 6.0 and includes:

- Changed EF migration history table to use a single column as primary key.
- Removed installer validation when MySql for Visual Studio is installed.
- Added idempotent script for Entity Framework 6 migrations.
- Fix for WI #824, Connector/NET writes wrong version for binding redirects.
- Fix for WI #825, Connector/NET 6.8.1 writes wrong namespace for binding redirects.


The release is available to download at http://dev.mysql.com/downloads/connector/net/#downloads


Documentation
-------------------------------------
You can view current Connector/Net documentation at http://dev.mysql.com/doc/refman/5.6/en/connector-net.html


You can find our team blog at http://blogs.oracle.com/MySQLOnWindows
You can also post questions on our forums at http://forums.mysql.com/

Enjoy and thanks for the support!

Connector/NET Team

Does Connector/Net 6.7.4.0 support EF6 (1 reply)

$
0
0
I'm using
VS 2012 update 3
EF 6
Connector/Net 6.7.0.4
MySql for VS 1.0.2

for a C3 app that needs to connect to a remote 5.5.13 MySQL Community Server Db.
I have generated the edmx file an the entity/mapping/context classes from the Db and have an application that compiles... The issue is with the app.config file.
I've added the DbProviderFactory ...
<DbProviderFactories>
<clear />
<add name="MySQL Data Provider"
invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data,
Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>

But get the error
"Schema specified is not valid. Errors: \r\nCVCommand.ssdl(2,2) : error 0152: No Entity Framework provider found for the ADO.NET provider with invariant name 'MySql.Data.MySqlClient'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information."

I presume that this in inferring that I need to add an entry in to the <entityFramework><providers> section. I have found an example on the net ...
<providers>
<provider invariantName="MySql.Data.MySqlClient"
type="MySql.Data.MySqlClient.MySqlProviderServices,
MySql.Data.Entity" />
</providers>

But that doesn't work.

So What do I need to do? Is EF6 supported.

Visual Studio Plugin broken with Windows 8.1 (1 reply)

$
0
0
Hello,
I have a Visual Studio 2012 project connecting to a MySql database using Visual Studio Plugin on Windows 8.

It stopped working after upgrading to Windows 8.1
Before 8.1 I was able to compile, edit Entity Framework diagrams, and run it.

After 8.1 Visual Studio tells me that the Provider does not exists.

I tried to update both the connector and Visual Studio Plugin, but they are already up to date.
I do not have a Mysql Database on my developer machine, but I'm connecting to a remote server hosting the database.

How can I fix it? I need a working mysql connection to continue my developing.

Thank you for your answers.

.open() not throwing exception.... (no replies)

$
0
0
I have a C# console application that connects to a remote MySQL dB via the V6.7.4.0 MySQL Connector/Net. This AM the ISP at the remote dB host's has been having issues and has been up and down over the last 80 to 90 minutes. I took this as an opportunity to tighten up the error handling in my code. After working with it for a while, I got a debugger pop up with the line "conDatabase.Open();" highlighted as shown in the following code snip:

try
{
conDatabase = new MySqlConnection( conString );
// do a test open so we know the server is up and running....
conDatabase.Open();
dBConnected = true;
}
catch (MySqlException errorMsg)
{
Console.WriteLine( "Database Error: " + errorMsg.Message);
Logger( errorMsg.Message, '1', true);
}


Why didn't this go into the catch block?

Thank you!

How data and time are written in binary logs (no replies)

$
0
0
Hi, I'm writing a program that reads binary files.
I have problem to read and parse date, time and timestamp columns.
I have no idea in what format they are stored in the binary logs.
Does anyone know how to read them from the binary log and convert them to readable year/month/day format?

TIA
Viewing all 1447 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>