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

Hang on MySqlConnection.Open (no replies)

$
0
0
I am currently attempting to port a C# application from windows/.net/visual studio to Ubuntu/mono/monodevelop. My app is using Mysql with the .net connector. The application works in windows with the same setup.

In ubuntu, the application does manage to connect to the server, and performs some work. However at a later stage, the application hangs. On investigating the hang in Monodevelop, I see that the thread communicating with the mysql server is hung on a monitor wait. The call stack is as follows.


System.Threading.Monitor.TryEnter (obj={object}, millisecondsTimeout=-1, lockTaken=false) in
System.Threading.Monitor.Enter (obj={object}, lockTaken=false) in
System.Resources.ResourceManager.GetString (name="PerfMonCategoryName", culture={System.Globalization.CultureInfo}) in
MySql.Data.MySqlClient.Properties.Resources.get_PerfMonCategoryName () in
MySql.Data.MySqlClient.PerformanceMonitor..ctor (connection={MySql.Data.MySqlClient.MySqlConnection}) in
MySql.Data.MySqlClient.MySqlConnection.Open () in
Persistate.DbWorker.EnsureConnection (workItem={Persistate.DbWorkItem}
etc.


It seems that in the MySqlConnection.Open call, the connector is attempting to get a resource string for the performance monitor, and the resource manager is using a lock and hanging on that. There are no other threads which are anywhere within the connector or the resource manager. Anybody have any ideas here? Anybody seen anything like this?

Regards, Stuart

How to store chinese characters (no replies)

$
0
0
I have my table an columes all set to utf8_default.

I am using the .NET Connector.

When I save chinese characters to the database, they end up as ??.
Looking at the server logs, the query contains the ??, so it must be a connector issue.

How can I set the "encoding" for the connector (both queries and responses) to UTF8?

...Matt

Linq Group by performance (no replies)

$
0
0
I'm using Entity framework with the latest connector for .net (6.4.4) in C#

I'm trying a simple groupby query on a very large table (100,000,000 records) in linq

var imprs = from axi in db.aximpressions
where axi.Axd_SiteID == 2
group axi by axi.Axd_BannerID
into g
select new
{
g.Key,
Sum = g.Sum(i => i.Axi_Impressions)
};

The query takes a few minutes to execute

Here is the weird .ToTraceString()

SELECT `GroupBy1`.`K1` AS `Axd_BannerID`,
`GroupBy1`.`A1` AS `C1`
FROM
(
SELECT `Extent1`.`Axd_BannerID` AS `K1`,
SUM(`Extent1`.`Axi_Impressions`) AS `A1`
FROM
(
SELECT
`aximpression`.`Axi_ID`,
[...]
`aximpression`.`Axi_InViewTime`
FROM `aximpression` AS `aximpression`) AS `Extent1`
WHERE 2 = ` Extent1`.`Axd_SiteID`
GROUP BY `Extent1`.`Axd_BannerID`) AS `GroupBy1`"

The innermost query select ALL records
Then another query filter on the Axd_SiteID field
Finally the group by is done on the outermost query

Now I understand why it takes forever
But why the generated query isn't something simple like this ?

select axd_bannerid,
sum(axi_impression)
from AxImpression
where axd_siteid = 2
group by axd_bannerid

This execute in a few seconds

Thanks!
Michel

Unable to instanciate MySqlConnection in vb.net thread (no replies)

$
0
0
Hello,

The following code works fine as long as it is within the main thread of a VB app:

Imports MySql.Data.MySqlClient
Imports System.Data
Imports Utilities

Public Class Command
Private con As MySqlConnection
Private cmd As MySqlCommand
Private rec As MySqlDataReader

Public Sub New()
Try
con = New MySqlConnection()
con.ConnectionString = "... blah blah..."
con.Open()

cmd = New MySqlCommand()
cmd.Connection = con
[...]
Catch e As Exception
Logger.Log(e.Message & vbCrLf & e.StackTrace)
End Try
End Sub

... but when it runs in a new thread, it fails here:
con = New MySqlConnection()
I cannot figure out what the problem is since the thread hangs right away and the sole exception that get trapped is:

System.Threading.ThreadAbortException {Unable to evaluate expression.}


I've been googlling it for 2 days, found similar cases with using ASP (which also instanciates threads btw...) but no good answer. Any clue getns ?

compiling the mysql.data dll fails (no replies)

$
0
0
I downloaded the connector for mysql (the dot net version). I then ran Microsoft Visual Web Developer, where I want to make an asp.net project that uses mysql. But when I tried to get Visual Web Developer to find the mysql.data.dll file, it could not add a reference to it, because the file was missing: it was not in the connector folder.
I did see source code for mysql.data.dll in the connector folder, which is written in csharp. So I downloaded Microsoft's compiler for csharp (dot net version) and tried to compile the source files. But I got all sorts of errors, including that the project file was wrong.
There must be some simple way of either getting hold of the dll, or creating it from source code.
But I can't find any posting on the net that says how to do this, even though some helpful folks have tried to list links that might be relevant.
Thanks,
Gid

Can't use mysql on mono Linux OpenSuse (1 reply)

$
0
0
hello every one,
i'm trying to build a simple console application using Mono framework and a MySQL server as a backend data base,

i'm using MySQL Connector/Net 6.4

==================================================================================
when i try to reference the assembly from an absolute dir i get the following error from the gmsc compiler :
Missing method .ctor in assembly /home/mostafa/projects/c-sharp/mysql_test/mysql.data.dll, type System.Security.SecurityRulesAttribute
Can't find custom attr constructor image: /home/mostafa/projects/c-sharp/mysql_test/mysql.data.dll mtoken: 0x0a00002b

when i try to reference the assembly from the GAC i get the following error :
error CS0006: cannot find metadata file `MySql.Data'

table insert and read data (no replies)

$
0
0
Hello ALL,

I am using .net connector for mysql.
I have created stored procedure to insert data and select data from the table.
The stored procedure works for insert data.
but i am unable to read the data.
I want to insert data dynamic and read the data from the table dynamic.
I am able to insert but read data is not working it will work after i refresh the mysql manually.
I am using xampp.

thanks

WCF dll to include? (no replies)

$
0
0
Hi All,

I have written a WCF client in VS2010 to return data from my MySql DB, when I test the client locally it runs fine and returns data from my remote database.

After I publish the app to the WCF server (running IIS7) and run the client from there, there is no data returned and I can't see any error being returned either, just an empty object.

The IIS server and the MySql DB are on the same server. I have included the MySql.dll in the deployement package and I can see it in the app folder on the server.

I tested the same thing with a MSSQL server and that worked fine but I prefer to use MySql.

What am I missing?

Dean

UNABLE TO CONNECT TO ANY OF THE SPECIFIED MYSQL HOSTS (no replies)

$
0
0
Hi,

Every now and again I'm getting the following error.

UNABLE TO CONNECT TO ANY OF THE SPECIFIED MYSQL HOSTS

I have set pooling to false, I have the IP set to 127.0.0.1 and I'm using the .NET connector. This could occur for a couple of minutes only while the application is running 24/7 and then fix itself.

Any ideas of what or how I trace the problem?

Thanks,
Jim

Enumerating MySQL Server Instances (no replies)

$
0
0
I have written an application that uses the SmoApplication.EnumAvailableSqlServers(False) method to obtain a list of all available SQL Servers. I am trying to expand my application such that it can do this with instances of MySQL Server also. I am using .NET 3.5 with Visual Studio 2008 which includes the MySQL Connector/NET (ie. MySQL.Data.dll) namespace. I have searched for solutions/hints/comments on the web to no avail. Is there a method one might recommend to acheive this?

Unable to find the requested .Net Framework Data Provider. It may not be installed. (no replies)

$
0
0
Regards,

It is possible to apply these same concepts of interconnection with MySQL using asp: SqlDataSource??

<Asp: SqlDataSource ID = "MySqlDataSource" runat = "server" ConnectionString ="<%$ ConnectionStrings: MySQLConnectionString%> "
SelectCommand ="..."
ProviderName ="<%$ ConnectionStrings: MySQLConnectionString.ProviderName%> ">
</ Asp: SqlDataSource>

Comment because I run the development side I run everything perfectly, however when I run and to use my production level generates the following error, accessing web shared Windows hostig domain with asp/php/mysql/sqlserver in www.godaddy.com:


Unable to find the requested. Net Framework Data Provider. It May not be installed.

Description: An unhandled exception occurred DURING the execution of the current web request. Please review the stack trace for more information About the mistake and Where It Originated in the code.

Exception Details: System.ArgumentException: Unable to find the requested. Net Framework Data Provider. It May not be installed.

Source Error:

An unhandled exception generated WAS DURING the execution of the current web request. Information Regarding the origin and location of the exception using the Can Be Identified exception stack trace below.

Stack Trace:


[ArgumentException: Unable to find the requested. Net Framework Data Provider. It May not be installed.]
System.Data.Common.DbProviderFactories.GetFactory (String providerInvariantName) +1415431
System.Web.UI.WebControls.SqlDataSource.GetDbProviderFactory () +67
System.Web.UI.WebControls.SqlDataSource.GetDbProviderFactorySecure () +22
System.Web.UI.WebControls.SqlDataSource.CreateConnection (String connectionString) +11
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect (DataSourceSelectArguments arguments) +117
System.Web.UI.WebControls.Repeater.GetData () +54
System.Web.UI.WebControls.Repeater.CreateControlHierarchy (Boolean useDataSource) +248
System.Web.UI.WebControls.Repeater.OnDataBinding (EventArgs e) +61
System.Web.UI.WebControls.Repeater.DataBind () +76
System.Web.UI.WebControls.Repeater.EnsureDataBound () +57
System.Web.UI.WebControls.Repeater.OnPreRender (EventArgs e) +15
System.Web.UI.Control.PreRenderRecursiveInternal () +103
System.Web.UI.Control.PreRenderRecursiveInternal () +175
System.Web.UI.Control.PreRenderRecursiveInternal () +175
System.Web.UI.Control.PreRenderRecursiveInternal () +175
System.Web.UI.Control.PreRenderRecursiveInternal () +175
System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

Version Information: Microsoft. NET Framework Version: 4.0.30319; ASP.NET Version: 4.0.30319.1



IN THE CONFIGURATION AREA SECTION GODADDY FOR APPLIANCE CONECTION, but not function:

Connector/Net 1.0 (.NET):
Server=fulanito.db.7994347.hostedresource.com; Port=3306; Database=fulanito; Uid=fulanito; Pwd='your password';



Thank you.

'check parameters=false' in connection string (no replies)

$
0
0
I had to add "check parameters=false" to my connection string in order to call a stored procedure for a user that has no SELECT privileges. What does "check parameters=false" actually do?
Thanks for any reply!
Thomas

Mysql 4.1 in VS2010 (no replies)

$
0
0
Hi,
I've searched in forum, find nothing about this
I read the documentation about mysql connector net, but still I'm not sure about a problem I have.

I need to develop a project in VisualStudio 2010, and I hav a problem with mysql 4.1 version, no problem with entity framework on mysql 5.0, but
using mysql4.1 I cannot figure a way to create an entity framework model in VS 2010.

so...questions:
is it possible to create entity framework edmx in VS2010 on a database mysql4.1?

any way to work with entity framework with mysql version prior to 5.0?

thanks

Vinay Naidu Gali, Which driver i can used to connect to MY SQL (1 reply)

$
0
0
Hi,

I am using JDBC driver to connect to MySQL DB but i am getting an exception that unable to connect.

Is there any specific driver or provider to connect to MySQL DB using ASP.NET ?

Thanks,
Vinay Naidu Gali.

Web Designing And Web Development (no replies)

$
0
0
In recent times, there has been a great demand for web application services. Webley Infotech Pvt.Ltd., a web development
company based in India, has been creating high quality software solutions. We have a team of skilled professionals who are committed to excellence and pays attention to your specific requirements. They are proficient in different web programming languages and can provide cutting-edge solutions that will help you to race ahead of your competitors. Nothing is monotonous or a routine affair for our professionals. Our web development champions readily take up any challenge and actively engage in website development activity using diverse, high-end technological platforms. Among leading Web Development companies in India, we are ready to develop attractive, fast-loading, search engine optimized sites with easy and user-friendly direction. Our team of expert web developers delivers creativity bundled with technical expertise to give that important zing, presence and impact to your website. When you work with us to make the web work for you, we first develop a web development strategy. Till the time project gets complete, we work in acknowledgment with you, step by step to implement unique web strategy to your fullest satisfaction. Our skillful web developers work with you to determine the focus, purpose and style for your site.
Want to create a long term impression on minds of visitors with the first look of your web site? Or your existing web site with simple HTML is not attracting enough traffic? A little use of Flash design to your site can make all the difference. The touch of simple HTML is not enough. A balanced fusion of Flash with HTML will draw more visitors to your site. Webley Infotech Pvt.Ltd. is a web design company that offers creative, professional and skilled web page design. As a creative web design company in India, our skilled professionals can deliver small business web designs as well as web designs for larger business requirements. Custom website designers and developers at our company emphasize on delivering our clients with customized and user-friendly designs. You can outsource web design projects to our company. Our company is a web design agency providing our clients with creative websites that offer complete satisfaction and offshore web design. From static HTML websites to fully featured flash websites, web portals, shopping cart web development, e-commerce website. Our custom website designers and developers can offer affordable web design services.

Which version of Connector/NET works with MySQL Server 4.1.22 (no replies)

$
0
0
Hello,

I have been testing a integration program between accounting software and an eCommerce site amd everything was going well until I discovered that the lattest versions of Connector/NET do not support MySQL server prior to 5.0.

Can anyone tell me what version of Connector/NET I need to install to work with MySQL 4.1.22. Also, where to get it would be handy.

Thanks in advance

Dennis Bowtell

Problems with the Entity Framework library (2 replies)

$
0
0
I have a problem inserting a row using Entity Framework with the MySQL Connector/NET 6.4.4. When I try to save the changes after adding 1 row I get a System.NullReferenceException with the following stack-trace:


at MySql.Data.Entity.SqlGenerator.GenerateReturningSql(DbModificationCommandTree tree, DbExpression returning)
at MySql.Data.Entity.UpdateGenerator.GenerateSQL(DbCommandTree tree)
at MySql.Data.MySqlClient.MySqlProviderServices.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree)
at System.Data.Common.DbProviderServices.CreateCommandDefinition(DbCommandTree commandTree)
at System.Data.Common.DbProviderServices.CreateCommand(DbCommandTree commandTree)
at System.Data.Mapping.Update.Internal.UpdateTranslator.CreateCommand(DbModificationCommandTree commandTree)
at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.CreateCommand(UpdateTranslator translator, Dictionary`2 identifierValues)
at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues)
at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
at System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager entityCache)
at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)
at System.Data.Entity.Internal.InternalContext.SaveChanges()
at System.Data.Entity.Internal.LazyInternalContext.SaveChanges()
at System.Data.Entity.DbContext.SaveChanges()
at UserData.Repository.DBRepositoryDataContext.SaveChanges() in C:\SoftwareProjects\Java\Degoo\Server\UserData\Repository\DBRepositoryDataContext.cs:line 42
at UserData.Repository.Repository.<SaveChanges>b__1() in C:\SoftwareProjects\Java\Degoo\Server\UserData\Repository\Repository.cs:line 137
at Microsoft.AppFabricCAT.Samples.Azure.TransientFaultHandling.RetryPolicy`1.ExecuteAction(Action action) in C:\SoftwareProjects\Java\Degoo\Server\Libraries\TransientFaultHandlingFramework\RetryPolicy.cs:line 352


Any ideas on what's causing this?

Delete (no replies)

$
0
0
SORRY, I just notice I posted in the wrong forum, I apologist.

I created a simple page with a Droplist using Visual Studio 2010 (VB.net) to test a MySQL database hosted in Godaddy; while the website runs fine locally with Full access, if I try to upload it to godaddy or run it locally with "<trust level="Medium"></trust>" I get an error.

System.Security.SecurityException: Request for the permission of type 'System.Net.SocketPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I googled and tried several different "solutions", trying to upload and use old versions of the Connector, modified versions and even compiling my own modifying the Assembly line "allowpartiallytrustedcallers" and nothing.
I also tried adding this to my web.config:

<system.data>
<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.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>

Adding "allowpartiallytrustedcallers" to the assembly of my project to no Vail.
What it gets me is that the website is so simple (one droplist) and it doesnt even run (medium trust) locally.

I would appreciate any help in this matter, thought I am not in a hurry as Godaddy allows me to have one more MS SQL server database and that one seems to work for now.

MySQL Connector/NET does not run in Medium Trust Locally (no replies)

$
0
0
I created a simple page with a Droplist using Visual Studio 2010 (VB.net) to test a MySQL database hosted in Godaddy; while the website runs fine locally with Full access, if I try to upload it to godaddy or run it locally with "<trust level="Medium"></trust>" I get an error.

System.Security.SecurityException: Request for the permission of type 'System.Net.SocketPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I googled and tried several different "solutions", trying to upload and use old versions of the Connector, modified versions and even compiling my own modifying the Assembly line "allowpartiallytrustedcallers" and nothing.
I also tried adding this to my web.config:

<system.data>
<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.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>

Adding "allowpartiallytrustedcallers" to the assembly of my project to no Vail.
What it gets me is that the website is so simple (one droplist) and it doesnt even run (medium trust) locally.

I would appreciate any help in this matter, thought I am not in a hurry as Godaddy allows me to have one more MS SQL server database and that one seems to work for now.

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

$
0
0
Hi you all.

I'm having a problem with my own app developed in VB.net 2010. First of all I'm going to give you my configuration to make you an idea of what I'm talking about.

OS: WindowsXP Pro SP3
MySQL Server: 5.5
Connector .NET: 6.4.4

First of all I configured file my.ini to accept remote connetions by adding the line bind-address=0.0.0.0 and I erased line that says skip-networking.

When I run my app localy, I login as root user and everything works fine. The problem came when I tried to remotely access to MySQL. I login as root user and everything works fine until the vb code executes the following:

DbGCATPacientes_PersonalespacientesTableAdapter.Fill(DbGCATPacientes_Personales.pacientes)

This line raises the Error 1042 - Unable to connect to any of the specified MySQL hosts

So I access the server via command line. I login without any problem and type in show proccesslist; to see the connections. There is a connection for the app. Grants for user root are all for *.* and for the database I created in mysql. And I also have a user 'root'@'%' with all privileges to ensure that remote hosts can access the database.

Where can be the problem? I don't understand, if I can login mysql without any problem, why or what raises this error and just for remote connection?

Thanks and waitting for an answer,
Gustavo
Viewing all 1447 articles
Browse latest View live


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