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

Exception thrown when trying to connect to db "Attempted to read past the end of the stream." (no replies)

$
0
0
I'm working on getting an application deployed to our live server, that uses Connector/Net 6.4.4 to connect our .NET application to MySql and am getting the following exception thrown:

Reading from the stream has failed. Inner Exception: Attempted to read past the end of the stream.

The connection is local, using root user. There are two connection strings (there are two, one for ADO.NET, one for Entity framework).

The mysql error log contains nothing relating to this issue. I have checked for access denied using process monitor, but nothing is flagged up.

The production server is MySql 5.1.11 which is the one we are having trouble setting up on, and we have development versions of the application running on 5.1.11 and 5.5.9, which work fine.

<add name="AppEntities" connectionString="metadata=res://*/OrmApp.AppEntities.csdl|res://*/OrmApp.AppEntities.ssdl|res://*/OrmApp.AppEntities.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=localhost;User Id=root;password=*********;Persist Security Info=True;database=app_staging;Convert Zero Datetime=True&quot;" providerName="System.Data.EntityClient" />

<add name="AppAdoNet" connectionString="server=localhost;User Id=root;password=*********;Persist Security Info=True;database=app_staging;Convert Zero Datetime=True" providerName="System.Data.MySql" />


How can I diagnose the specific reason for the failed connection?

Understanding the General Query Log (1 reply)

$
0
0
Can anybody help me interpret what's in the General Query Log?

My output looks something like this:


1 Init DB wheresmysh_t
1 Query call GetObjectsFromContainer (10)
1 Init DB wheresmysh_t
1 Query SELECT * FROM Container WHERE parentContainerId = 60
1 Init DB wheresmysh_t
1 Query call GetObjectsFromContainer (60)
1 Init DB wheresmysh_t
1 Query SELECT * FROM Container WHERE parentContainerId = 24

What does the 1 mean? Does "Init DB" mean that there's a new client connection? Would you expect there to be some sort of "Disconnect DB" statement in there?

I haven't seen any information on the web about how to read this file's contents, so if anyone knows of one...

What do I need to download to mysql in asp.net (1 reply)

$
0
0
Hello!

I just wonder what do I need to download to be able to use mysql in ASP.NET in the same way that I can use sql server from server explorer in visual studio.

//Tony

vb.net crystal report get data from existing mysql xml dataset (no replies)

$
0
0
Please move or delete this thread if this is not the correct forum

I am using MySQL Connector/NET 5.2.7 for visual studio 2005, and I've got a myDataSet.xsd in my visual studio project which I got from my data source connection, a MySQL Database (MySQL Data Provider)

The problem is when I use the existing ADO.NET dataset (myDataSet.xsd) as a data source through the new report wizard in crystal reports in vs 2005, the tables and field names are available in the newly created report, but the data is blank (i.e. no data to browse)

But, if I make a new data source for the crystal report, using the ODBC connection string...

Driver={MySQL ODBC 5.1 Driver};Server=myServerAddress;Database=myDataBase;User=myUsername; Password=myPassword;Option=3;

... it works (the database fields are not blank and I can browse them, but the text type and memo type fields are unavailable)

But, I wish to use the same dataset (myDataSet.xsd) acquired from the MySQL Database (MySQL Data Provider) for the crystal report and not the ODBC

Please advise

Thanks

best connector for using crystal reports in Visual studio 2005 (no replies)

$
0
0
I'm having problems using mySQL datasets in crystal reports in Visual studio 2005
Currently I'm using mySQL Connector/Net 5.2 in Visual studio 2005 because mySQL connector/Net version 6 doesnt seem to be integrated in VS 2005 (its supported in Visual studio 2008)
Anyways, the crystal report is not able to read some database fields nor int(11) or text/longtext types (memo fields)
I wish to find the most uptodate .NET sql connector (or ODBC connector) which doesnt have these crystal reports bugs

Collating Sequence (no replies)

$
0
0
looking at my data in MYSQL Workbench I see data in the following sort order:

aaaa
ac-2900
ac-45
ac100
ac100-10

In my VB.Net Program, my grid bound to Mysql database shows same table data sorted as:

aaaa
ac100
ac100-10
ac-2900
ac-45

Why the difference in collating position of "-"?

According to ASCII Chart, the character sequence is: - . / 0 1 2 3

Curious!

Lee

Web Design and Development (no replies)

$
0
0
Web Design is an fine art ! you hire a professional website design company with cutting-edge technology. Years of professional experience and unmatched customer service offers you website designing with exceptional value. we are web design service provider worldwide, we are web design company in india.

We have high level proficiency in designing and developing best websites, ecommerce and database websites with merchant account integration and also CMS websites . The process is very simple and begins with FREE MOCKUP of site design with unlimited revisions and once approved the site is coded and developed in requested platform. We also design w3c verified DIV (XHTML) websites for better SEO performance.

¿MySQL Exception: Fatal error encountered attempting to read the resultset. VB.NET? (no replies)

$
0
0
Okay, here's the situation.
When I try to execute this query,"SELECT CONCAT(LEFT(es401,2),'', LPAD(TRIM(LEADING '0' FROM SUBSTRING(es401,4)),6, ' ')) AS CLAVE, es404 AS PRIMERO, es405 AS ULTIMO FROM est04 AS MENSAJES ORDER BY CLAVE ASC", to fill a Datatable, it shows me a "MySQL Exception Error: Fatal error encountered attempting to read the resultset."
I hope someone can help me with this situation.
By the way, I'm programming in VB.NET 4.0 Framework.
Greetings.


CODE:

Dim strQryMSGS As String = ""
Dim strConnMSql As String = "server=localhost;User Id=Din;password=abc;Persist Security Info=True;database=estacion"
Dim connMSql As New MySqlConnection(strConnMSql)
Dim cmdMsgs As New MySqlCommand(strQryMSGS, connMSql)
Dim daMSql As New MySqlDataAdapter(cmdMsgs)
Dim tableMSql As New DataTable

strQryMSGS = "SELECT CONCAT(LEFT(es401,2),'', LPAD(TRIM(LEADING '0' FROM SUBSTRING(es401,4)),6, ' ')) AS CLAVE, es404 AS PRIMERO, es405 AS ULTIMO FROM est04 AS MENSAJES ORDER BY CLAVE ASC"

cmdMsgs = New MySqlCommand(strQryMSGS, connMSql)
daMSql = New MySqlDataAdapter(cmdMsgs)
tableMSql = New DataTable
daMSql.Fill(tableMSql)

Entity Framework migrations (no replies)

$
0
0
why MySQL Connector .NET not support Entity Framework migrations?

Mysql dll version changing (no replies)

$
0
0
Dear friends,
I am the beginner of using mysql server. I am using mysql 5.5 server,mysql dll 1.0.10.0 and mysql connector 6.4.3. its working fine but while transfering the project from one system to another system , mysql dll version is changed to 6.4.3 or 1.0.8 .can u suggest what should i do to resolve it. please help me..



Thanks in Advance,
Dj.

Changing of Mysql Dll Version (no replies)

$
0
0
Dear friends,
I am the beginner of using mysql server. I am using mysql 5.5 server,mysql dll 1.0.10.0 and mysql connector 6.4.3. its working fine but while transfering the project from one system to another system , mysql dll version is changed to 6.4.3 or 1.0.8 .can u suggest what should i do to resolve it. please help me..



Thanks in Advance,
Dj.

Connecting From ASP.NET to MySql (no replies)

$
0
0
Hello,

I have programmed a web site in visual studio 2010. There, I connect to my MySql server and all works fine.

Two days ago I bought an IIS 7 Server which support asp.net and .NET 4.0,.Now I'm trying to oprate the site from the server.

I uploaded all the aspx and .cs pages to the server.

The Server doesnt recognize my MySql reference, not the assembly of MySql(which in the web.config) and not the using MySql.Data.MySqlClient in the .cs files.

<assemblies>
<add assembly="MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
</assemblies>
I have no idea why it happens, perhaps I have to upload MySql.dll file and somehow connect the reffrence to the .dll.

I would be glad if you could help me, thanks, Yogev

vs 2010 data connection (no replies)

$
0
0
Have visual studio 2010. Am trying to create connection to a mysql database on my machine (localhost). I have downloaded connector/net driver.

I am able to open the mysql database from the command line with no problem.

However when I try to create a data connection in vs 2010 I only get message "Unable to connect to any specified mysql hosts." I specify server (localhost or my computer name) and a valid mysql user/pass (with which I accessed database on the command line). When click to test connection, get message above.

If click OK instead of test connection, I get window entitled "Input user name and password for localhost:3306." But when I enter user name/password get same "Unable to connect..." message.

Thanks for any hints.

LOAD DATA INFILE ASP.NET (no replies)

$
0
0
I am having trouble using the MySql data connection to make a button onclick to run a query.

So basically I am making an application to easily update our MySql database by having the user upload the txt file (Tab Delimited), and then once its uploaded they are redirected to another page (import.aspx) that has a button.

When clicked this button is supposed to connect to the MySql database and implement the LOAD DATA INFILE statement to grab the file uploaded and use that as the source for the statement.

I can't figure out how to connect to the database to do such a thing. I am using the connection method in the Web.Config file. basically, the statement would be something like:

LOAD DATA INFILE 'Server.mappath("~/uploads/Update.txt")' into table test; when the button is clicked. Since it is a tab-delimited file, would this statement change.

Below is the ASP Code I wrote.
Any help would be appreciated.

Thanks.

-Matt







====START CODE====

Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
Dim connection As MySqlConnection = New MySqlConnection(ConfigurationManager.ConnectionStrings("TestConnectionString").ConnectionString)
Try
Dim path As String
path = Server.MapPath("~/uploads/Update.txt")
'path = path.Replace("/", "//")
Dim command As MySqlCommand = New MySqlCommand("LOAD DATA INFILE'" + path + "'into table names;", connection)
'SAMPLE SQL: LOAD DATA INFILE 'c:/wamp/www/upload/Update.txt' into table names;
connection.Open()
command.ExecuteNonQuery()
connection.Close()
Finally
If connection.State = ConnectionState.Open Then
connection.Close()
Response.Redirect("~/Default.aspx")
End If

End Try



End Sub

====END CODE====

time to timespan conversion, negative values (no replies)

$
0
0
I am using MySQL .NET Connector for C#. It has been working perfectly
until recently. I have a field in my MySQL Table storing data of type
TIME. Identically in my .NET application, I have a dataset with a table
and a field of type TIMESPAN. My C# application calculates a time
difference and stores it in the MySQL database. The time difference may
be of negative value. The negative values are being stored correctly in
the database. The problem occurs when I use a TableAdapter in C# to fill
my .NET data table in code, hence reading back the values from MySQL
into C#. Values less than an hour are always loaded as positive value,
no mather if it is negative or positive in the MySQL table. Values
stored in the MySQL table which are more than one hour in value are
being loaded with correct sign.

Even though I use a scalar query to load a single TIME value into a
variable the query is not able to keep the sign of negative time values
(values less than one hour).

CODE:
MySqlConnection myConn = new MySqlConnection(DatabaseConnectionString);
MySqlCommand myCommand = new MySqlCommand("MY QUERY", myConn);
MySqlDataAdapter myAdapter = new MySqlDataAdapter();
System.Data.DataTable myData = new DataTable();

myConn.Open();
myAdapter.SelectCommand = myCommand;
myAdapter.Fill(myData); //Load data into table

CODE END

I am not sure if it matters, but in my connection string I have set
"Allow Zero Datetime=True" to handle possible DateTime issues.
Any idea what causes the wrong sign for values less than one hour when
reading data from MySQL into C# Data Table?

Example: stored value in MySQL table is -02:45:00 read value in C#
is -02:45:00
Example: stored value in MySQL table is -00:30:00 read value in C# is
00:30:00 (sign lost!)

EntityFramework string column types. (no replies)

$
0
0
I just re-built connector for my own purpose, with this fix ( http://forums.mysql.com/read.php?38,519005,525880#msg-525880 ). While looking further through the code, i ran into this :

if (isFixedLength)
{
typeName = isMaxLength || maxLength > CHAR_MAXLEN ? "varchar" : "char";
maxLength = isMaxLength ? VARCHAR_MAXLEN : maxLength;
}
else
{
if (maxLength < CHAR_MAXLEN) typeName = "tinytext";
if (maxLength < VARCHAR_MAXLEN) typeName = "text";
if (maxLength < MEDIUMTEXT_MAXLEN) typeName = "mediumtext";
else typeName = "longtext";
}

Correct me if I'm wrong, but it seems that this code will always generate MEDIUMTEXT columns for variable length string with length < MEDIUMTEXT_MAXLEN.

You might want to change the "else" block for something like this :

if (maxLength < CHAR_MAXLEN) typeName = "tinytext";
else if (maxLength < VARCHAR_MAXLEN) typeName = "text";
else if (maxLength < MEDIUMTEXT_MAXLEN) typeName = "mediumtext";
else typeName = "longtext";


(Besides this, as I'm not aware of a way to define a fixed length string while using EF Code First, it will generate a mediumtext whenever you want a string... that is not a novel.)

MySql Big5-HKSCS problem (no replies)

$
0
0
Hi all,
I am using ADO.net with mysql connector
I have created a table in database using InnoDB with the collation of utf8_general_ci
The version of the MySql is 5.5.24.


The following is the DDL of the table

delimiter $$

CREATE TABLE `testing` (
`Id` varchar(50) CHARACTER SET utf8 NOT NULL,
`Value` varchar(45) CHARACTER SET utf8 NOT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci$$



Then, I created a winform with a textbox for user to input text.
I found that if there is any HKSCS in the textbox, mysql will throw exception and said that the field cannot be null.


The following is my insert statement (I am using prepare statement)
insert into Testing (Id, Value) values (?id, ?value)

and I pass the parameter using MySqlParamter.
com.Parameters.Add(new MySqlParameter("?id", Guid.NewGuid().ToString()));
com.Parameters.Add(new MySqlParameter("?value", value));

When I use debugger to inspect the value, it should not be null and it has the value of user input. however, mysql throw the exception that the value is null.

The testing input text that I used is "梁四𠰠"


Does anyone know how to solve the problem?

Connection string not working properly in .NET application (no replies)

$
0
0
Hi,

I'm having a bit of an issue while using my connection string. My connection string looks like this:

server=remote_server;database=db_name;uid=root;password=XXXX

However, when I launch my application it seems that the connection string is defaulting to localhost becasue I get a message saying:

Access denied for user 'root'@'my_computer_name' (using password: YES)

When I blank out the password I get the following:

Access denied for user 'root'@'my_computer_name' (using password: NO)

It seems as though it is using part of the connection string, but not others. I'm simply trying to connect my application to a remote mysql instance. Has anyone experienced or know about an issue like this?

Any help is greatly appreciated! Thank you in advanced.

How to Connect to MySQL Using C# (no replies)

MySQL Connector/Net 6.6.0 Alpha has been released (no replies)

$
0
0
MySQL Connector/Net 6.6.0, a new version of the all-managed .NET driver for MySQL has been released. This is the first of two alpha releases intended to introduce users to the new features in the release. This release is not feature complete and there are significant limitations but it should be stable enough for users to understand the new features and how we expect them to work. As is the case with all non-GA releases, it 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.)

The 6.6 version of MySQL Connector/Net brings the following new features:

Stored procedure debugging
Entity Framework 4.3 Code First support
Pluggable authentication (not available in this alpha)

Stored Procedure Debugging
-------------------------------------------
We are very excited to introduce stored procedure debugging into our Visual Studio integration. It works in a very intuitive manner by simply clicking 'Debug Routine' from Server Explorer. As mentioned above, there are currently many limitations in the implementation. These limitations are being resolved for future alpha and beta releases. The limitations include:

* Can only debug stored procedures. Functions and triggers will be enabled in a future build.
* Intellisense is currently not enabled in the debugger window.
* Some MySQL functions cannot be debugged currently (get_lock, release_lock, begin, commit, rollback, set transaction level)
* Only 5.1 grammar is currently supported
* Only one debug session may be active on a given server
* The debugger instruments your procedures automatically. We have seen some instances when the original procedure is not restored correctly.
* Evaluating and changing session variables are not supported. Local variables in the procedure are supported.
* Breakpoints are supported however if you put a breakpoint on a line where there is no code it will appear as not bound. This is harmless
* Conditional breakpoints are not supported
* When debugging a routine that has parameters the debugger will prompt for those values. It will create session variables out of them so you should be careful to not use your own session variables that have the same name.
* When creating a new connection in Server Explorer, please check the 'Save password' checkbox.

While this list is long, we have already resolved many of these and will resolve the rest before GA. Even with these limitations we hope that you can get a feel for how the product will work and give us feedback.

Documentation
-------------------------------------
The documentation is still being developed and will be readily available in time for Beta 1. You can view current Connector/Net documentation at http://dev.mysql.com/doc/refman/5.5/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!
Viewing all 1448 articles
Browse latest View live


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