mysql.data

MySqlDataReader.GetStream() throws IndexOutOfRangeException

老子叫甜甜 提交于 2021-02-11 06:42:33
问题 So I'm using the MySql.Data package for my .NET Core project and store password hashes and salts (of type byte[] ) as varbinary() to the database. When selecting the password hash and salt from a user I need a way to convert the result back to a byte array. Given this sample code Stream passwordHashStream = dbDataReader.GetStream(0); byte[] passwordHash; using (MemoryStream memoryStream = new MemoryStream()) { await passwordHashStream.CopyToAsync(memoryStream); passwordHash = memoryStream

Why does opening a connection throw a distributed transactions error in MySQL? (.NET Connector)

佐手、 提交于 2020-01-14 14:32:14
问题 I'm opening a connection to a local MySQL server and on the connection.Open() method it throws this error: System.NotSupportedException: MySQL Connector/Net does not currently support distributed transactions. at MySql.Data.MySqlClient.MySqlConnection.EnlistTransaction(Transaction> transaction) at MySql.Data.MySqlClient.MySqlConnection.Open() All I'm doing is this: var connection = new MySql.Data.MySqlClient.MySqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ConnectionString

Unable to update EntityFramework models from MySQL database in Visual Studio 2015 RC

时间秒杀一切 提交于 2020-01-13 08:22:08
问题 My organization upgraded from Visual Studio 2013 to Visual Studio 2015 RC a couple months ago, and we only just now attempted to update some of our existing "db-first" EntityFramework models from our MySQL database. When doing so, we received the following error. An exception of type 'System.ArgumentException' occurred while attempting to update from the database. The exception message is: 'Unable to convert runtime connection string to its design-time equivalent. The libraries required to

Dapper is throwing an invalid cast exception when trying to set a boolean value returned from MySQL

China☆狼群 提交于 2019-12-23 07:19:38
问题 I have this class public class User { public int UserId { get; set; } public string UserName { get; set; } public bool IsValidated { get; set; } } And I'm populating it with this sql using dapper: var users = connection.Query<User>("SELECT userId, userName, TRUE `IsValidated` FROM user WHERE [...]").ToList(); When I run this I get this error: Error parsing column 2 (IsValidated=1 - Int64) I've stepped through the dapper code & the sqldatareader is saying that that column is int64 , so it

ServiceStack Ormlite - Joins on child classes

瘦欲@ 提交于 2019-12-13 08:10:01
问题 I'm using the latest ServiceStack Ormlite (v4.0.23), which provides new join support for joining on multiple columns. My entities all inherit from a BaseEntity: public class BaseEntity : IBaseEntity { [AutoIncrement] [PrimaryKey] public long Id { get; set; } public DateTime Created { get; set; } public DateTime Updated { get; set; } public DateTime? Deleted { get; set; } public bool IsDeleted { get; set; } } Say I have 2 entities, UserEntity and AnswerEntity, which inherit from this base

Unable to update EntityFramework models from MySQL database in Visual Studio 2015 RC

我的未来我决定 提交于 2019-12-05 02:23:25
My organization upgraded from Visual Studio 2013 to Visual Studio 2015 RC a couple months ago, and we only just now attempted to update some of our existing "db-first" EntityFramework models from our MySQL database. When doing so, we received the following error. An exception of type 'System.ArgumentException' occurred while attempting to update from the database. The exception message is: 'Unable to convert runtime connection string to its design-time equivalent. The libraries required to enable Visual Studio to communicate with the database for design purposes (DDEX provider) are not

MySql.Data.MySqlClient.MySqlException: “The host localhost does not support SSL connections.”

感情迁移 提交于 2019-11-27 11:31:05
I use msyql.data 8.08 and .net core to connect to mysql5.7.18 but following exception is being thrown: MySql.Data.MySqlClient.MySqlException:“The host localhost does not support SSL connections.” How to deal with it? I had the same problem today when moving from MySql.Data 7.0.7 to 8.0.8. I was able to move forward adding the "SslMode=none" in the connection string. You will endup with something like: server={0};user id={1};password={2};persistsecurityinfo=True;port={3};database={4};SslMode=none (replacing the values with your database details) And if you using a connection pool class, then

MySql.Data.MySqlClient.MySqlException: “The host localhost does not support SSL connections.”

大城市里の小女人 提交于 2019-11-26 15:36:31
问题 I use msyql.data 8.08 and .net core to connect to mysql5.7.18 but following exception is being thrown: MySql.Data.MySqlClient.MySqlException:“The host localhost does not support SSL connections.” How to deal with it? 回答1: I had the same problem today when moving from MySql.Data 7.0.7 to 8.0.8. I was able to move forward adding the "SslMode=none" in the connection string. You will endup with something like: server={0};user id={1};password={2};persistsecurityinfo=True;port={3};database={4}