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

MySQL Connector/NET: Using MySqlClientPermission Class to restrict data access (no replies)


MySQL Connector/NET: Intellisense Support in Visual Studio (no replies)

Inheritance with Entity Framework (no replies)

$
0
0
I'm trying to use MySQL's .NET Connector with Entity Framework, but I'm getting an error:

"Schema specified is not valid. Errors:
(11,6) : error 0064: Facet 'MaxLength' must not be specified for type 'mediumtext'."

This happens whenever I want to use class inheritance with my POCO classes. I've posted a complete example of my tests after the break. If I was using SQL Server to achieve this, EF4.1 would automatically create a column called "Discriminator" on my table to control the entries. I guess there's something about the way MySQL interacts with this feature that is broken.

This post is kind of cross-posted from http://stackoverflow.com/q/8700497/891772.

Thanks in advance!

---------------------------------------

Example:

public abstract class Vehicle
{
public int Id { get; set; }
public int Year { get; set; }
}

public class Car : Vehicle
{
public string CarProperty { get; set; }
}

public class Bike : Vehicle
{
public string BikeProperty { get; set; }
}

public class Db : DbContext
{
public DbSet<Vehicle> Vehicles { get; set; }
public DbSet<Car> Cars { get; set; }
public DbSet<Bike> Bikes { get; set; }
}

Bug #61108 (no replies)

$
0
0
Does the fix for bug #61108 affect connections to existing databases where the tables are already mixed case?

Store image to mysql database using vb.net (no replies)

$
0
0
Im having difficulty with regards to storing the uploaded images to the database (mySQL - as my back-end) using VB.net (as my front-end)..

in "picture" table, i have the following fields and its corresponding data types.
ID = int
file_name = varchar
file = blob
..

:)

Error Adding a Connection in Visual Studio (no replies)

$
0
0
I have MySQL running on Windows 2008 R2 Standard Server and have installed the MySQL .NET Connector on that server. I have Visual Studio 2008 running on an XP workstation, and have installed the .NET Connector on that devic as well. I am able to attempt to add a new connection from Visual Studio to MySQL, as defined in the MySQL NET/Connector reference. However, when I attempt to test the connection, I get an Access Denied error for any valid user, including "root". Is there some configuration step I may be missing. I am NOT running IIS on the MySQL Windows server.

Watch Chelsea v Sunderland Live Football Match Saturday 14 Jan 2012 (no replies)

$
0
0
As seen, now everyone is furious about football matches. People try their level best to get the tickets to watch the match live but not everyone succeed. Here is your chance to watch live the great game.
All teams are trying to take top position in the football league matches. Both teams are prepared well for this league match. Let’s see who will win this match.
<strong>Watch Now Chelsea v Sunderland</strong>

ENJOY @ http://entertainment.igrcs.com/?p=210

ENJOY @ http://entertainment.igrcs.com/?p=210

ENJOY @ http://entertainment.igrcs.com/?p=210


Watch Chelsea v Sunderland, live Chelsea v Sunderland, online Chelsea v Sunderland, free Chelsea v Sunderland, stream Chelsea v Sunderland, highlights Chelsea v Sunderland, scores Chelsea v Sunderland,preview Chelsea v Sunderland, analysis Chelsea v Sunderland

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

$
0
0
'Unable to connect to Any of the specified MySQL hosts' only on Windows Embedded POSReady 2009 and when there is no network connection. After plugging a network cable all is well.

In the other version of Windows (even XP) the problem does not exist.

Someone to help me?

duplicate my_aspnet tables (no replies)

$
0
0
Hi Friends,

I am migrating my website and my MySql database, including the my_aspnet tables (membership, profiles, users, etc). On the current host the my_aspnet tables are in lowercase, so are they on my Windows based localhost. However, the autogenerate settings on my new host created the my_aspnet tables with some uppercase characters. As a result there are duplicate entries for each my_aspnet table, and the website cannot „see” the users and their corresonding information in the lowercase tables, so I cannot login and use any information stored in the my_aspnet tables. It would be possible to delete the uppercase tables and rename the lowercase tables into uppercase ones, but then they would not be compatible with the tables on my localhost. (if I set the autogenerate schema option to false, I get the following errorr message: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.)

Is there a way to „force” MySql to generate and use lower-case my_aspnet tables?

Any suggestion is highly appreciated.
Best Wishes,
Zolly

unable to connect any of the specified mysql hosts (no replies)

$
0
0
I Had built a application in VB.NET 2008. I had install my application on windows server
2008 R2(64 bit). My Database is installed on Windows 7(32bit). MySQL ODBC Connector 3.51
Now I had created a short cut on machine A and machine B.
Machine A- Windows XP (32 bit)
Machine B- Windows 7 (32 Bit), DB server.
Whenever I run shortcut from B machine application works properly but when I run shortcut
from A machine I get error as "unable to connect any of the specified mysql hosts".
After trying many times I had install the application A machine and then tried and it
worked.
But now its not possible for me to install the application on each of my machine. Kindly
give me solution for the same.

Thank You in Advance.

Error while connecting to Database using VB. Net Application (no replies)

$
0
0
I Had built a application in VB.NET 2008. I had install my application on windows server
2008 R2(64 bit). My Database is installed on Windows 7(32bit). MySQL ODBC Connector 3.51
Now I had created a short cut on machine A and machine B.
Machine A- Windows XP (32 bit)
Machine B- Windows 7 (32 Bit), DB server.
Whenever I run shortcut from B machine application works properly but when I run shortcut
from A machine I get error as "unable to connect any of the specified mysql hosts".
After trying many times I had install the application A machine and then tried and it
worked.
But now its not possible for me to install the application on each of my machine. Kindly
give me solution for the same.

Thank You in Advance.

Connection to MySQL 5.0 within ASP.NET MVC Project fail (no replies)

$
0
0
(may I haved put this into the wrong forum place, so I will do it here again)

I am using mysql-connector-net-6.4.4 with Visual Studio 10 Prof.

I get the error: "Unable to connect to any of the specified MySQL hosts"
error-no: 1042 = ER_BAD_HOST_ERROR.

With "MySQL Administrator or MySQL Workbench I am able to get a connection to the database (also with MySQL Query Browser).

But in my ASP.NET Project it does not work?

That is the code I use within the C# Project:
String myConnectionString = "server=127.0.0.1;"
+ "uid=root;"
+ "Persist Security Info=True;"
+ "pwd=secret;"
+ "port=3333;"
+ "database=test;"
+ "charset=latin1;"
;

try
{
MySqlConnection conMySQL = new MySqlConnection();
conMySQL.ConnectionString = myConnectionString;
conMySQL.Open();
//later execute queries, etc
conMySQL.Close();
}
catch (MySqlException ex)
{
string sMessage = ex.Message;
}

I have referenced in my ASP.NET MVC project:
C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\MySql.Data\v4.0_6.4.4.0__c5687fc88969c44d\MySql.Data.dll

C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\MySql.Data.Entity\v4.0_6.4.4.0__c5687fc88969c44d\MySql.Data.Entity.dll

C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\MySql.Web\v4.0_6.4.4.0__c5687fc88969c44d\MySql.Web.dll

After a long search I have done to program a connection with a simple WindowsForms Project and VS2010 and the same connection-code above. This has worked! I could fetch some data.

But withnin the ASP.NET MVC3 project not. I have try to put the code in Global.asax.cs in Application_Start(){...} at the very begining. But I can get figured out what is the diffence between the Windowsform-App (which works) and the ASP.NET-App (which works not).

The exact error message is:
"A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll"
"A first chance exception of type 'System.Net.Sockets.SocketException' occurred in MySql.Data.dll"
"A first chance exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll"
"WebDev.WebServer40.exe Error: 0 : Unable to connect to any of the specified MySQL hosts."

Can anyone please give me an advice, how can get I fixed this?

Maybe it is a premission problem with "WebDev.WebServer40.exe" (the internal ISS which comes with the Visual Studio)?


Thanks a lot for help. I have not found anything useful with Google.
Harald

VS2010 MySQL Connector and .Net 3.5 (no replies)

$
0
0
I have VS2010 running in Windows 7 Professional (.Net 4 installed). Currently have Net Connector 6.3.8 installed. I also have a few activex controls that AREN'T .Net 4 compatible yet but will compile in .Net 3.5.

So, my dilemma is this:

I need to compile my app using .Net 3.5. When setting the Target Framework to 3.5 I cannot retrieve the reference to the mysql.data.dll as it doesn't appear in the References list in VS2010.

Reviewing the Net Connector compatibility chart has put a scare into me because it looks like Net Connectors 6.3 and 6.4 have VS2010 compatibility but NOT with .net 3.5.

Can anybody recommend a solution that would allow me to compile my VS2010 app in a .net 3.5 framework?

BTW, I've tried both 6.4.4 and 6.3.8 Connectors but neither appear to work.

Looking forward to your responses!

Maintaining leading zeros (no replies)

$
0
0
All the primary keys in my database are zerofilled, but when I go to import them to a listbox (as shown below), they lose the leading zeros. How can I maintain the leading zeros?

Public Sub ListboxQuery(ByVal Query As String, ByVal ResultObject As Object, ByVal ResultDisplay As String, ByVal ResultValue As String)
'queries the database for a 1- or 2-column list of values to display in a listbox
Dim myCommand As New MySqlCommand
Dim myAdapter As New MySqlDataAdapter
Dim myData As New DataTable

Try
Conn.Open()
Try
myCommand.Connection = Conn
myCommand.CommandText = Query
myAdapter.SelectCommand = myCommand
myAdapter.Fill(myData)
ResultObject.DataSource = myData
ResultObject.displaymember = ResultDisplay
ResultObject.valuemember = ResultValue
Catch myerror As MySqlException
MsgBox("Error reading from the database: " & myerror.Message)
End Try
Catch myerror As MySqlException
MessageBox.Show("Error connecting to database: " & myerror.Message)
Finally
If Conn.State <> ConnectionState.Closed Then Conn.Close()
End Try
'deselects or unchecks the listbox
If TypeOf ResultObject Is ComboBox Then
ResultObject.selectedindex = -1
ResultObject.text = ""
Else
For i As Integer = 0 To (ResultObject.selecteditems.count - 1)
If TypeOf ResultObject Is CheckedListBox Then
ResultObject.setitemchecked(i, False)
End If
ResultObject.setselected(i, False)

Next
End If

End Sub

temporary tables and threads (no replies)

$
0
0
Hi,
I'm trying to parallelize several querys that are using temporary tables. One thread for each table (diferent names).
When running one thread everthing is ok and fast.
With two I start recieving the error:
Can't find file: 'j:\db4\t_tablename.frm' (errno: -1)

My ConnectionString:
connection_P.ConnectionString = "server=" & server & ";user id=" & user & ";password=" & pass & ";database=" & database & ";" & _
"Protocol=tcp;" & _
"Compress=" & compress.ToString & ";" & _
"Pooling=false;" & _
"Port=" & port & ";" & _
"Connect Timeout=300000;" & _
"Respect Binary Flags=false;" & _
"Allow Batch=true;"

The .NET code for creating threads:
Parallel.ForEach(tablelist, options, (Sub(tableName As String)
Dim newdatabase As mysql_net = ConnectDatabase()
Dim p As processTimeAggPeg = New processTimeAggPeg(tableName, newdatabase)
p.start()
End Sub))

MySQL version is 5.1.11

Can anyone help me?
Thx

MySql.Data.CF.dll missingmanifestresourceexception (no replies)

$
0
0
I am new to SmartDeviceProject. So When i try to connect MySQL to my project, MissingManifestResourceException through in Connection.open in below code?.

string connectionString = "Persist Security Info=False;server=192.168.1.100;database=mcubic;User Name=mcubic;Password=mcs@2011$;pooling=false";
string query = "select b.Outlet_Master_Name from mcs_user_outlet a,outlet_master b where a.Mcs_User_Outlet_User_Id=3 and a.Mcs_User_Outlet_Outlet_Id = b.Outlet_Master_Id";
MySqlConnection connection = new MySqlConnection(connectionString);
MySqlCommand command = new MySqlCommand(query, connection);
connection.Open();
MySqlDataReader Reader = command.ExecuteReader();
while (Reader.Read())
{
comboBox1.Items.Add(Reader[0].ToString());
}
connection.Close();

Insert dataset into database (no replies)

$
0
0
I am new to mysql, i have a dataset which contains of some 5000 rows. Now is there any way to insert the dataset into mysql database without iterating through the 5000 rows?

Thank you

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

$
0
0
MySQL Connector/Net 6.5.1, a new version of the all-managed .NET driver for MySQL has been released. This is a beta release of our newest connector and comes with several new features. It is of beta quality and should not be used in any production environment. 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.)

This new versions brings new features such as

Exception and command injector support
Millseconds support
Better partial-trust support
Better intellisense including auto-completion when editing stored procedures or .mysql files

These features are not yet documented in the shipping documentation. We have posted a series of posts to our blog outlining these new features.

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!

MySql communication problems with .NET (no replies)

$
0
0
Hi

I'm trying to connect MySQL with Microsoft Visual Web Developer 2005, but without success.
When I try to add a data connection, I get the information that an unexpected error occurred in the .NET Framework data provider for MySql.
Can anyone tell me what I' doing wrong?

MySql EntityFramework Issue (no replies)

$
0
0
I'm using VS2010 (EntityFramework) to connect MySql.
Even though I'm able to connect to MySql through EntityFramework,
But lastly it shows no entities in model browser ??

How to reslove this?
Viewing all 1447 articles
Browse latest View live


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