mysql-connector

LINQ-to-entities: predicating on a DateTime field causes AccessViolationException

落爺英雄遲暮 提交于 2019-12-11 08:15:11
问题 I have the following code: var dtThreshold = DateTime.Now.AddDays(-1); using (var db = new TermbaseEntities()) { var tc = (from termChanges in db.st_element_audit_log where termChanges.element_type_id == (long) ElementType.Term && termChanges.recorded > dtThreshold select termChanges).ToArray(); ... } In the DB entities, st_element_audit_log.recorded is a DateTime property. It's a fairly trivial statement, but running it causes the following exception: Unhandled Exception:

MySQL XCode C++ Connector Bad Access code=13

我是研究僧i 提交于 2019-12-11 07:09:41
问题 I have a problem with getting MySQL working with my code. I get the EXC_BAD_ACCESS(code=EXC_i386_GPFLT) error on the connect line. The code is the following: try { driver =sql::mysql::get_driver_instance(); connection = driver->connect("tcp://127.0.0.1:3306/", "root", ""); I've seen the post MySQL Connector/C++ OS X 10.9 Mavericks and XCODE 5.0.2 but I can't do the same thing because I use a bunch of libraries that were linked the same way, and they are more difficult to configure in Xcode

MySql Connection not closing using .net MySql Connector

耗尽温柔 提交于 2019-12-11 03:38:38
问题 MySql Connection is going to sleep mode instead of close in mysql. I am using MySql.Data 6.5.4 version to communicate with mysql. I am not sure what am I doing wrong in below code. try { using (var conn = new MySqlConnection(strConnection)) { conn.Open(); using (var cmd = new MySqlCommand(strSQLStatement, conn)) { var adapter = new MySqlDataAdapter(cmd); adapter.Fill(ds); } } } catch (Exception ex) { ErrorLogger.WriteError(string.Format("Failed query {0} with stack trace {1} ",

mysql.connector, multi=True, sql variable assignment not working

有些话、适合烂在心里 提交于 2019-12-11 03:23:07
问题 SQL code (all in one file that is eventually saved in the python variable "query"): select @dtmax:=DATE_FORMAT(max(dt), '%Y%m') from table_A; delete from table_B where DATE_FORMAT(dt, '%Y%m')=@dtmax; Does mysql-connector allow the use of variable assignment like I've done in the query above. i.e. take the value of max(date) from TABLE_A and delete everything with that date from TABLE_B. python code: c = conn.cursor(buffered=True) c.execute(query, multi=True) conn.commit() conn.close() All I

MySQL Connector, Streaming Resultsets and Batch Fetching

家住魔仙堡 提交于 2019-12-11 02:26:15
问题 I was browsing through the MySQL Connector (5.1.24) source code and I noticed something unusual in the method StatementImpl#createStreamingResultSet The javadoc says We only stream result sets when they are forward-only, read-only, and the fetch size has been set to Integer.MIN_VALUE @return true if this result set should be streamed row at-a-time , rather than read all at once. This makes me believe that if we want to stream result sets in MySQL, then there is no option of retrieving rows in

Bulding mysql-connector c++ application in debug on Windows, VS2K17

会有一股神秘感。 提交于 2019-12-11 02:01:52
问题 I'm trying to run a simple mysql-connector (c++) application in debug mode, but it seems to fail when it gets to the following line (see full source below): pstmt = con->prepareStatement(query); and using the Local Windows Debugger in Visual Studio, it stops [at that line above] with this Exception Unhandled: Unhandled exception at 0x00007FFD7921A388 in Database.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0000004F7E8FC920. This same application runs fine if I set my

use parameter from method argument inside linq contains

若如初见. 提交于 2019-12-11 01:51:58
问题 i have a problem using Contains() method with parameter coming from the method arguments. i am using entity framework core 1.1 and mysql connector version 6.10.0-alpha. i have this code: public IEnumerable<Message> search(string content) { var bla = this.appDbContext.Messages.Where(x => x.Content.Contains("edit")).ToList(); var bla1 = this.appDbContext.Messages.Where(x => x.Content=="edit").ToList(); var bla2 = this.appDbContext.Messages.Where(x => x.Content==content).ToList(); var bla3 =

i can't access to mysql database from c#

老子叫甜甜 提交于 2019-12-11 01:48:42
问题 i have a web site and in it's phpmyadmin create a database and i want to connect to it from c# . i use MySQL connector for .NET in visual studio 2010. my String Connection is : server=158.58.185.197;database=porbarco_base;uid=****;pwd=****;CharSet=utf8; but i can't connect to database and give an error : Unable to connect to any of the specified MySQL hosts. How i can connect to this database. i see many threads in stackoverflow but don't solve my problem. 回答1: The likelyhood is that the

MySQL Connector/NET Output Parameter Returning NULL

依然范特西╮ 提交于 2019-12-10 19:51:23
问题 Using the following code: MySqlParameter curParam = new MySqlParameter("var", MySqlDbType.Int32); curParam.Direction = System.Data.ParameterDirection.Output; oCmd.Parameters.Add(curParam); With the following Stored Procedure: CREATE PROCEDURE testProc(OUT var INT) BEGIN SELECT 1, 2, 3; SELECT 27 INTO var; END $$ Running this from the console returns "27": CALL testProc(@i); SELECT @i; However in .NET, when executing the query (when the connection is still open), curParam.value returns NULL.

Running a built .NET application which required MySql.Data

痞子三分冷 提交于 2019-12-10 19:24:33
问题 Im having a problem running a built .NET application which I wrote: My application uses the latest MySql connector which is installed on my system and shows up as a .NET 4 Framwork component when I try to add it as a reference. When I run my application in debug mode in the environment everything works great, but when I try to run it as a stand alone application straight from the "release" folder, I get the following exception: Unhandled Exception: System.IO.FileNotFoundException: Could not