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

SSL Cipher doesn't exist in MySqlConnectionStringBuilder (no replies)

$
0
0
Hi,

I'm trying to create a MySqlConnection with some SSL parameters, but none of this combinations: "cipher", "sslcipher", "ssl_cipher", "ssl-cipher" or "ssl cipher" are not allowed in connectionString.
Can you help me with this issue? I'm trying this:
var builder = new MySqlConnectionStringBuilder();
builder.Server = "127.0.0.1";
builder.Port = 3306;
builder.UserID = "root";
builder.Password = "password";
builder.SslCert = "C:\\file.pem";
builder.SslKey = "C:\\file.pem";
builder.SslCa = "C:\\file.pem";
builder.SslCipher = "TLS_RSA_WITH_DES_CBC_SHA"; //doesn't have this property
var conn = new MySqlConnection(builder.ToString());
conn.Open();

Regards,
Ivan!

MySql.Data.MySqlClient.MySqlException :Fatal error encountered during command execution. (no replies)

$
0
0
Dear Support,



I have been having the following error message that some time appears. Most of the time it works, but it appears that some times it give me this fatal error. It appears to be random, it will work fine for some queries then that same query fails the next time it runs.
I have done some investigating and have tried to increase the connection timeouts and command timeouts, Yet on some machines this happens randomly.




Any suggestions on how to fix these errors.


The following Excpetion was caught:

Fatal error encountered during command execution. MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered during command execution. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered attempting to read the resultset. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Reading from the stream has failed. ---> System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count) at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count) at MySql.Data.MySqlClient.MySqlStream.LoadPacket() at MySql.Data.MySqlClient.MySqlStream.LoadPacket() at MySql.Data.MySqlClient.MySqlStream.ReadPacket() at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId) at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId) at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at Launcher.LodgeDocument.uploadDocument(Int32 selectedRow) in C:\source\repos\Launcher\Launcher\LodgeDocument.cs:line 209 at Launcher.LodgeDocument.dgDocumentView_CellDoubleClick(Object sender, DataGridViewCellEventArgs e) in C:\source\repos\Launcher\Launcher\LodgeDocument.cs:line 147



my code:

static System.Threading.Timer timer;
static void Main(string[] args)
{


System.Threading.TimerCallback callback = new System.Threading.TimerCallback(insert);
timer = new System.Threading.Timer(callback, null, 1000, 1000);

System.Threading.Thread.Sleep(Timeout.Infinite);



}

public static void insert(object obj)
{
try
{

MySqlConnection con1 = new MySqlConnection();
MySqlDataAdapter ODA;


con1.ConnectionString = "server=localhost;uid=root;pwd=Stpl@1234;database=s1;port=3306;Allow User Variables=True;Connect Timeout=30";

string query1="", insertquery = "";
for (int i=0;i<10000;i++)
{
query1 += "select " + i + " as DTvalue Union " + Environment.NewLine;

}

// string query1 += "select '" + obj1 + "' as DTvalue ," + readingdata[counter1].Quality + " as DTquality ,'" + datetm + "' as DTtimestamp ," + readingdata[counter1].HandleClient + " as DTparamID Union " + Environment.NewLine;



if (query1 != "")
{
query1 = query1.Remove(query1.LastIndexOf("Union"));
insertquery += " insert into t1 " + Environment.NewLine;
insertquery += "(id)" + Environment.NewLine;
insertquery += " " + query1 + " ";
if (con1.State == ConnectionState.Closed)
con1.Open();
using (MySqlCommand cmd1 = new MySqlCommand(insertquery, con1))
{
cmd1.ExecuteNonQuery();
}
if ((con1.State == ConnectionState.Connecting) || (con1.State == ConnectionState.Open))
con1.Close();
}
}
catch(Exception ex)
{

}
}



in insert function exception is coming .


Thanks

MySql.Data.EntityFramework v8.0.18 EF6 netstandard2.1 (no replies)

$
0
0
Hello,

Currently receiving the following warning:

Warning NU1701 Package 'MySql.Data.EntityFramework 8.0.18' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.1'. This package may not be fully compatible with your project.

Though MySql.Data can target netstandard2.1, and Entity.Framework (v6.3) can target netstandard2.1.

Is this being updated in an upcoming release? 8.0.19/20

Thanks

Migration from mysql-connector-net 6.6.5 to 8.0.18 (no replies)

$
0
0
Dear Gurus!
In previous years, a number of services have been developed that work with mysql-connector-net 6.6.5.Now I switched to VS 2019, using Blazor. To work with EF Core, I need to do scaffolding in new programs, and for this I install mysql-connector-net 8.0.18. In this regard, a few questions. Old versions of programs, if I understand correctly, must be rebuild to a new connector. Both versions of the connector will not work at the same time.
I began to do so. Install mysql-connector-net-8.0.18 and mysql-for-visualstudio-1.2.9. When accessing a specific "myobj" context table

using (gpsEntities context = new gpsEntities())
{
List<myobj> lst = context.myobjs.ToList();
}
I get error:
"System.DllNotFoundException
HResult=0x80131524
Message=MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.18.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d
Source=MySql.Data"
How to do it right?

MySql .Net Connector Problem over EntityFramework (1 reply)

$
0
0
Mysql .Net Connector latest version (8.0.19) does not match nuget Mysql.Data and Mysql.Data.Entity packages. On Visual Studios when Mysql database connection has selected and then clicked the next button dialogbox just close without any warning or error message. I think this because version divergent between connector (8.0.19) and the Mysql.data and entity packages .

C# Program ignoring Timeout setting (1 reply)

$
0
0
Hi folks,

IN my connection string I am setting a timeout..

"server=**.*.*.**;Uid=root;Pwd=*****;database=sst;Convert Zero Datetime=True;Port=3306;Connection Timeout=1200;

But when I run the program, it times out after 30 seconds.

I have also changed my ini file to ...
[mysqld]
wait_timeout = 1200
interactive_timeout = 1200

Any ideas ??

Unable to convert MySQL data/time value to System.DataTimerloadDtg (no replies)

$
0
0
Hello can anyone help me with this every time I try to update info to my localhost it gives me this error Unable to convert MySQL data/time value to System.DataTimerloadDtg and the app crashes

MySQL Connector Net failed to remove (no replies)

$
0
0
Hi,

I want to reinstall MySQL on my laptop. To remove the existing MySQL, I uninstalled it from the Control Panel and deleted all the MySQL folders from all the locations on my laptop. Now, when I try to install it again, the MySQL Connector Net is giving issues. I am trying to remove the MySQL Connector Net but it is failing. I have removed the occurrences of the same from the Registry but still, it is failing to upgrade/remove and hence I am not able to proceed with the MySQL installation. Any help would be appreciated. Thank you in advance.
I am attaching the error log for reference below -

Beginning remove step: Removing product Connector/NET 8.0.17
1: Action 18:45:13: INSTALL.
1: 1: MySQL Connector Net 8.0.17 2: {941162ED-6FB5-4F0C-8869-47432D92897D}
1: Action 18:45:13: FindRelatedProducts. Searching for related applications
1: Action 18:45:13: AppSearch. Searching for installed applications
1: Action 18:45:13: LaunchConditions. Evaluating launch conditions
1: Action 18:45:13: ValidateProductID.
1: Action 18:45:13: CostInitialize. Computing space requirements
1: Action 18:45:13: FileCost. Computing space requirements
1: Action 18:45:14: CostFinalize. Computing space requirements
1: Action 18:45:14: InstallValidate. Validating install
1: Action 18:45:14: Setv45InstallUtil.
1: Action 18:45:14: InstallInitialize.
1: Action 18:45:14: GenerateScript. Generating script operations for action:
1: InstallInitialize
1: Action 18:45:14: RemoveExistingProducts. Removing applications
1: Action 18:45:14: ProcessComponents. Updating component registration
1:
1: Action 18:45:14: MsiUnpublishAssemblies. Unpublishing assembly information
1: Application Context:Unpublishing assembly information, Assembly Name:
1: Action 18:45:14: UnpublishFeatures. Unpublishing Product Features
1: Action 18:45:14: UninstallPerfCounterData.
1: Action 18:45:14: RollbackUnregisterPerfCounterData.
1:
1: Action 18:45:14: UnregisterPerfCounterData.
1:
1: Action 18:45:14: RemoveRegistryValues. Removing system registry values
1: Key: Removing system registry values, Name:
1: Action 18:45:14: RemoveShortcuts. Removing shortcuts
1: Shortcut: Removing shortcuts
1: Action 18:45:14: ManagedDataUnInstallSetup.
1: Action 18:45:14: ManagedDataUnInstall. Unregistering data provider from machine.config
1: Action 18:45:14: ManagedWebUnInstallSetup.
1:
1: Action 18:45:14: RemoveFiles. Removing files
1: File: Removing files, Directory:
1: Action 18:45:14: RemoveFolders. Removing folders
1: Folder: Removing folders
1: Action 18:45:14: CreateFolders. Creating folders
1: Action 18:45:14: InstallFiles. Copying new files
1: Action 18:45:14: CreateShortcuts. Creating shortcuts
1: Action 18:45:14: WriteRegistryValues. Writing system registry values
1: Action 18:45:14: InstallPerfCounterData.
1: Action 18:45:14: RegisterUser. Registering user
1: Action 18:45:14: RegisterProduct. Registering product
1: Action 18:45:14: MsiPublishAssemblies. Publishing assembly information
1: Action 18:45:14: PublishFeatures. Publishing Product Features
1: Action 18:45:14: PublishProduct. Publishing product information
1:
1: Action 18:45:14: InstallFinalize.
1: Action 18:45:14: InstallInitialize.
1: Action 18:45:14: ProcessComponents. Updating component registration
1: Action 18:45:14: MsiUnpublishAssemblies. Unpublishing assembly information
1: Application Context:Global, Assembly Name:MySql.Data,version="8.0.17.0",culture="neutral",publicKeyToken="C5687FC88969C44D",processorArchitecture="MSIL"
1: Application Context:Global, Assembly Name:Google.Protobuf,version="3.6.1.0",culture="neutral",publicKeyToken="A7D26565BAC4D604",processorArchitecture="MSIL"
1: Application Context:Global, Assembly Name:BouncyCastle.Crypto,version="1.8.3.0",culture="neutral",publicKeyToken="0E99375E54769942"
1: Application Context:Global, Assembly Name:Renci.SshNet,version="2016.1.0.0",culture="neutral",publicKeyToken="C5687FC88969C44D",processorArchitecture="MSIL"
1: Application Context:Global, Assembly Name:SshNet.Security.Cryptography,version="1.2.0.0",culture="neutral",publicKeyToken="C5687FC88969C44D",processorArchitecture="MSIL"
1: Application Context:Global, Assembly Name:MySql.Web,version="8.0.17.0",culture="neutral",publicKeyToken="C5687FC88969C44D",processorArchitecture="MSIL"
1: Action 18:45:14: RollbackUnregisterPerfCounterData.
1: Action 18:45:14: UnregisterPerfCounterData.
1: Action 18:45:15: RemoveRegistryValues. Removing system registry values
1: Key: \Software\MySQL AB, Name: Default
1: Key: \Software\MySQL AB\MySQL Connector/Net, Name: Version
1: Key: \Software\MySQL AB\MySQL Connector/Net, Name: Location
1: Key: \Software\MySQL AB\MySQL Connector/Net, Name:
1: Key: \SOFTWARE\Microsoft\.NETFramework\v4.5.50709\AssemblyFoldersEx\MySQL Connector Net 8.0.17 v4.5.1, Name:
1: Key: \SOFTWARE\Microsoft\.NETFramework\v4.5.50709\AssemblyFoldersEx\MySQL Connector Net 8.0.17 v4.5.1, Name:
1: Key: \SYSTEM\CurrentControlSet\Services\.NET Data Provider for MySQL\Linkage, Name: Export
1: Key: \SYSTEM\CurrentControlSet\Services\.NET Data Provider for MySQL\Performance, Name:
1: Key: \SYSTEM\CurrentControlSet\Services\.NET Data Provider for MySQL\Performance, Name: Library
1: Key: \SYSTEM\CurrentControlSet\Services\.NET Data Provider for MySQL\Performance, Name: Open
1: Key: \SYSTEM\CurrentControlSet\Services\.NET Data Provider for MySQL\Performance, Name: Collect
1: Key: \SYSTEM\CurrentControlSet\Services\.NET Data Provider for MySQL\Performance, Name: Close
1: Key: \SYSTEM\CurrentControlSet\Services\.NET Data Provider for MySQL\Performance, Name: IsMultiInstance
1: Key: \SYSTEM\CurrentControlSet\Services\.NET Data Provider for MySQL\Performance, Name: Counter Names
1: Key: \SYSTEM\CurrentControlSet\Services\.NET Data Provider for MySQL\Performance, Name: Counter Types
1: Action 18:45:15: RemoveShortcuts. Removing shortcuts
1: Shortcut: upfn1-0t|Documentation
1: Shortcut: vaitcdd6|ChangeLog
1: Shortcut: _rq6aex9|Release Notes
1: Action 18:45:15: ManagedDataUnInstall. Unregistering data provider from machine.config
1: Action 18:45:15: Rollback. Rolling back action:
1: Unregistering data provider from machine.config
1: Removing shortcuts
1: Removing system registry values
1: UnregisterPerfCounterData
1: RollbackUnregisterPerfCounterData
1: Unpublishing assembly information
1: Updating component registration
1: InstallInitialize
1: 1: MySQL Connector Net 8.0.17 2: {941162ED-6FB5-4F0C-8869-47432D92897D} 3: 3
1: The action 'Remove' for product 'Connector/NET 8.0.17' failed.

Ended remove step: Removing product Connector/NET 8.0.17

Entity Framework 3.x Support (1 reply)

$
0
0
Does anyone know when Entity Framework 3.x support will come from the MySQL team? On the documentation they still only support 2.1. Entity Framework 5 will come out this year, will they be able to catch up? Seems like Oracle/MySQL is always way behind...

problem with uninstalling mysql connector net 8.0.19 (1 reply)

$
0
0
i have a windows server 2008 enterprise SP2, on this server is installed visual studio 2010, and the sharepoint 2010. i installed the mysql connector net 8.0. 19 because i need them for my bdc on external database in sharepoint but this application mysql connector 8.0.19 is not appopriate i need older version of this application. i tryed with installation the mysql connector net 6.64 but i receive message like on picture

Mysql enterprise 8 with .net core 3.1. Getting error Data is Null. This method or property cannot be called on Null values. (no replies)

$
0
0
I have .net core 3.1 application
I am getting following error on mysql 8 enterprise edition when connecting from a linux
rogram Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.
at MySql.Data.MySqlClient.MySqlDataReader.GetFieldValue(Int32 index, Boolean checkNull)


Strange thing is when trying to same db from windows i am not getting this error.
Stored procedure i am accessing having just one parameter.
Error from linux system removed when i added CheckParameters=false in the connection string.
But i am confused why it is happening as my stored procedure have no more then single parameter.

possibility of publishing mysql connector code on git (no replies)

MySQL Connector/NET 8.0.20 has been released (no replies)

Mysql 8 not connect give Bad Handshake error 1043 (no replies)

$
0
0
I am new in mysql database. I have installed Mysql for mysql installer on window.
I try to connect mysql from cmd it give me ERROR 1043 (08S01): Bad handshake.

Please guide how can i resolve the error.

Also how can i check my installation is correct?

Thanks

MySQL Connector/NET provider for Entity Framework Core 3.1 (no replies)


mysql connector 8.0.20 and mysql server 5.7.28 (1 reply)

$
0
0
Hi
in the prorgress of migrating.net core 2.1 -> .net core 3.1

linq to sql error

DateTime.AddDays(period)

INTERVAL CAST(CAST(`u`.`period` as double) as int) day

but mysql 5.7.28 casting not supported integer and double

how to cast int?

.net connector version : 8.0.20
.net core version : 3.1
mysql server version : 5.7.28

Microsoft Report Viewer (no replies)

$
0
0
I am newbie. Developing a .net solution for desktop back-end as mysql server. I am usinh workbench 8.0, .Net framework 4.6 and VS 2019. I have a database in MySql workbench and i'm implementing a code in vb.net.net application.Now i need to make a report in rdlc,but i can't connect rdlc report or dataset with MySql database. how can i do this? need your response as soon as possible. Thanks in Advance

Mysql Connector LEFT JOIN Bug (no replies)

$
0
0
Hello,

I can't believe what I am just facing. After many hours of research I ask you guys for help:

If you left join on console, phpmyadmin, heidisql or whatever you get a different result set than with mysql connector. I checked on different windows machines with different mysql versions and different connector versions, even the latest one.

Reproduce

CREATE TABLE `test1` (
`test1_ID` INT(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`test1_ID`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=MyISAM

INSERT INTO `test1` (`test1_ID`) VALUES ('1');
INSERT INTO `test1` (`test1_ID`) VALUES ('2');
INSERT INTO `test1` (`test1_ID`) VALUES ('3');

CREATE TABLE `test2` (
`test2_test1_ID` INT(11) NOT NULL,
`test2_test` VARCHAR(50) NOT NULL DEFAULT '' COLLATE 'utf8mb4_general_ci'
)
COLLATE='utf8mb4_general_ci'
ENGINE=MyISAM

INSERT INTO `test2` (`test2_test1_ID`, `test2_test`) VALUES ('1', 'a');
INSERT INTO `test2` (`test2_test1_ID`, `test2_test`) VALUES ('1', 'b');

Now run:
select test1_ID, test2_test from test1
left join test2 on test1_ID = test2_test1_ID

you will always receive 4 entries but with mysqlconnector there are only 3 rows in the resultset.

I kindly ask you for your help as I can't rely on correct results anymore.

How can we known the release plan or milestone (no replies)

$
0
0
Dear maintainer:

How can we known the release plan or milestone.

Pull last data record into a new table (2 replies)

$
0
0
want to thank you all for your help right away.

2 tables, I want to pull the last record from table1 column "ProjName" and input it into table 2 column "ProjName". (I will use this field to as the relationship between the two tables).

When "add record" button on the form is pressed it writes the data to table1 no problem. So right now it is coping the entire column. I need it to just copy the last record (the newest 'Name"). ... there's also a reset button so that the record isn't saved if the user wants.

I currently have the following code to do this in the button click event:

Dim dbs As Database

Set dbs = CurrentDb
dbs.Execute "INSERT INTO tbl_ProjDetails (ProjName) SELECT (ProjName) FROM tbl_Projectsummary;"

I tried using various versions of the DLast function, needless to say it doesn't work (I don't even know if it's able to work within the INSERT INTO):

dbs.Execute "INSERT INTO tbl_ProjDetails (ProjName) SELECT DLast(ProjName) From tbl_Projectsummary);"

I have also tried just pulling from the text box directly:
dbs.Execute "INSERT INTO tbl_ProjDetails (ProjName) VALUES('" & Me.txt_projname & "')"

Any thoughts on how to do this...? I may be trying to do this scenario the wrong way, so feel free to point me in another direction.

End goal - I need to fill out 5 record sets with that name in table2, each with a different department which is another column, but right now I would just be happy getting that last record to pull - as I figure the rest will just be standard INSERT INTO
Viewing all 1447 articles
Browse latest View live


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