问题标签 [mysql.data]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - MySQL 6.9.8 - 打开新连接时出现 System.String.Substring 异常
时不时地,当我进行数据库查询时,我会ExecuteNonQuery
在MySQL.Data
库中遇到问题。
引发的异常是:
Exception thrown: 'System.ArgumentOutOfRangeException' in CommonLanguageRuntimeLibrary ("Length cannot be less than zero.")
我有来自Azure Worker Role的IntelliTrace的日志。
它在大多数情况下都有效,但是当发生这种情况时,它会停止工作人员的正常处理。
我正在从 加载连接字符串app.config
,它看起来像这样:
<add key="DatabaseConnectionString" value="Server=localhost; Port=3306; Uid=user; Pwd=mypassword; Pooling=false;" />
我在运行时为每个请求选择数据库,因为它不断更改它连接到的数据库。
我能做些什么来阻止这种情况发生并允许新连接正确打开吗?
编辑
在进一步调查和爬取MySQL.Data
源代码后,我深入研究了这个getter
.
现在WorkerRole是否有可能在执行期间的某个时间开始为Environment.CommandLine属性返回不同的值?这似乎正在发生,因为它在开始时有效,然后在一段时间后(2-3 天)失败。
c# - 'where 子句'中的未知列'xy'
我正在使用这个查询
假设username
是 set toxic
,抛出的错误如下:
我已经尝试添加单引号 ('),引发了另一个错误(语法中的“有毒”附近有错误)。但是,我想知道该查询有什么问题?我详细阐述并发现证据表明这来自查询本身。
c# - 使用 `MySql.Data` 和 `MySql.Data.MySqlClient` 的区别
我正在尝试MariaDB
使用MySql.Data.dll
. 我认为它应该可以工作,因为它MariaDB
是 MySQL 的替代品。
在 StackOverflow 上找到了一个有用的答案,但是有一件事让我感到困惑。
在他或她的代码的最顶部,他或她使用using MySql.Data
and using MySql.Data.MySqlClient
。我发现的其他教程只提到了using MySql.Data
.
如果这个问题很愚蠢,我深表歉意,但我真的很想了解他或她为什么同时使用这两种陈述而不仅仅是using MySql.Data
?
c# - 忽略与可执行文件位于同一文件夹中的程序集 .dll
如果我将 MySql.Data.dll 程序集与可执行文件放在同一个文件夹中,我有一个 .NET 应用程序会崩溃,但如果我移动它就可以正常工作。同一文件夹中的不同可执行文件依赖于它,因此我需要将其保留在那里。
我该怎么做才能让应用忽略这个 dll?我假设我可以编辑配置文件,但我似乎找不到任何人有忽略本地 .dll 的问题,所以我不知道该写什么。
更让我困惑的是异常细节中写的关于加载程序集的部分。请注意,本地文件夹中的文件(我想忽略的那个)的版本是 6.9.9.0,异常状态是它要加载 6.9.5.0,而加载的文件(来自 GAC)是 6.9.8.0。
这是我的配置文件:
非常感谢您的帮助。
************** 异常文本 **************
System.IO.FileLoadException:无法加载文件或程序集“MySql.Data,Version=6.9.5.0,Culture=neutral,PublicKeyToken=c5687fc88969c44d”或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(来自 HRESULT 的异常:0x80131040)文件名:'MySql.Data,版本 = 6.9.5.0,文化 = 中性,PublicKeyToken = c5687fc88969c44d'在 System.Reflection.RuntimeAssembly._nLoad(AssemblyName 文件名,字符串代码库,证据 assemblySecurity,RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity,
1 uriRegistry, MetadataArtifactAssemblyResolver resolver) at System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.CreateResourceLoader(String path, ExtensionCheck extensionCheck, String validExtension, ICollection
1 uriRegistry,MetadataArtifactAssemblyResolver 解析器)在 System.Data.Metadata.Edm.MetadataArtifactLoader.Create(字符串路径,ExtensionCheck extensionCheck,字符串 validExtension,ICollection1 uriRegistry, MetadataArtifactAssemblyResolver resolver) at System.Data.Metadata.Edm.MetadataCache.SplitPaths(String paths) at System.Data.Common.Utils.Memoizer
2.<>c__DisplayClass4_0.b__0() 在 System.Data.Common.Utils.Memoizer2.Result.GetValue() at System.Data.Common.Utils.Memoizer
2.Evaluate(TArg arg) at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections) at System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection() at System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor ) 在 Panola.Data.Services.PanolaConfigurator..ctor(String Name) 在 Panola.Data.Services.PanolaConfigurator..ctor(String Name, Boolean UseDefualtRepositories) 在 Panola.Data.Models.PanolaDB..ctor()。 Tools.Configurator.MainForm.connectToolStripMenuItem_Click(Object sender, EventArgs e) 在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) 在 System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) 在 System.Windows。形式。ToolStripItem.HandleClick(EventArgs e) 在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) 在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) 在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 点击)在 System.Windows.Forms.ScrollableControl.WndProc(Message& m) 的 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.ToolStrip.WndProc(Message& m) 在 System.Windows。 Forms.ToolStripDropDown。WndProc(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd , Int32 msg, IntPtr wparam, IntPtr lparam)
vb.net - 无法加载文件或程序集 MySql.Data
我已经为 Visual Studio 和 .NET 连接器 (6.8.3.0) 安装了 MySQL。我之前安装了 6.7.4.0。为什么它还在寻找这个 DLL?
我收到错误消息表单事件查看器:
消息:无法加载文件或程序集 'MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' 或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(来自 HRESULT 的异常:0x80131040)
我使用编译的 .NET 框架版本是 .NET 框架 3.5
我已经为 Visual Studio 和 .NET 连接器 6.7.4.0 安装了 MySQL。并在之前运行成功(使用6.7.4时不会出现错误)但程序需要更改为6.8.3.0版本。
所以我再次下载并安装版本 6.8.3 并将其添加为参考并具有 Imports 行,但出现错误
如何解决这种错误,在 vb.net
mysql - Visual Studio 2015 未在 NuGet 中安装 Mysql.data
UWP App 无法使用 MySql
我在 UWP 中制作了一个应用程序,而不是使用似乎是 Visual Studio 2015 规范的 SQLLite,我想使用 MySql。我已经通过“服务器资源管理器”将我的 Azure mysql 数据库连接到 Visual Studio。
我正在使用 MySQL Workbench 从 Azure 更新我连接的数据库中的表,但我实际上无法编写任何代码来访问我的表,因为每当我尝试在 NuGet 包管理器中安装 MySql.data/.entity/etc 时都会收到错误消息.
我尝试下载 Mysql 安装程序、Ado 和 ODBC 的 Mysql 驱动程序。我什至尝试下载 MySql for Visual Studio 选项,因为我发现 Visual Studio 与 MySql 不兼容,而是需要 MySql for Visual Studio 下载但是每当我尝试在我的代码中使用 MySql 时我仍然有错误,因为我需要一个程序集参考它,但我没有运气能够得到一个不会出错的东西。
有人知道我如何在 Visual Studio 2015 中实际使用 MySql 吗?
这是我一直使用的指导方针,但在安装时我似乎无法克服 Mysql.data 错误。
http://web3.codeproject.com/Articles/1074242/Designig-your-Azure-MySQL-DB-with-a-UWP-Demo
我看到很多人谈论这个,但没有一个直接的修复(我尝试了很多修复,特别是使用 Vs13 在 Nuget 包管理器中安装 Mysql,然后它应该在 VS15 中更新但由于我的应用程序是 UWP VS13 实际上并没有加载/读取它,所以这个想法对我不利,但可能对其他人有帮助)
c# - 更改全局程序集缓存 (GAC) 中的 MySql.data 版本
So I have previously developed a payroll system using c# way back 2010, and I decided to use it again as a reference, I had its ClickOne Application Deployment Manifest, but when I tried to run it an error appears "Unable to install or run the application. the application requires that assembly MySQL.Data Version 5.1.7.0 be installed in the Global Assembly Cache (GAC) first". when I check the GAC on windows/assembly, I had MySQL.Data version 6.2.2.0, Is there a way to change/uninstall this and install a version 5.1.7.0?
I had searched for a possible answer to my questions but most of the results is on publishing, unfortunately I cant republish the application again as I lost my sql database, any help will do as I will continue browsing for possible answer.
thanks in advance.
c# - 来源:MySql.Data.Entity.EF6 索引超出了数组的范围
来源:MySql.Data.Entity.EF6 存储过程生成错误索引超出了数组的范围。
在 MySql.Data.Entity.EFMySqlDataReader.GetDataTypeName(Int32 序数) 在 System.Data.Entity.Core.Objects.Internal.BufferedDataRecord.ReadMetadata(String providerManifestToken, DbProviderServices providerServices, DbDataReader reader) 在 System.Data.Entity.Core.Objects。在 System.Data.Entity.Core.Objects.Internal.BufferedDataReader.Initialize(字符串 providerManifestToken、DbProviderServices providerServices、Type[ ] columnTypes, Boolean[] nullableColumns) 在 System.Data.Entity.Core.Objects.ObjectContext.CreateFunctionObjectResult[TElement](EntityCommand entityCommand, ReadOnlyCollection1 entitySets, EdmType[] edmTypes, ExecutionOptions executionOptions)
at System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass45
1.b__44() 在 System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func 1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass45
1.b__43() 在 System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func 1 operation)
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteFunction[TElement](String functionName, ExecutionOptions executionOptions, ObjectParameter[] parameters)
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteFunction[TElement](String functionName, MergeOption mergeOption, ObjectParameter[] parameters)
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteFunction[TElement](String functionName, ObjectParameter[] parameters)
at OMS.omsdbEntities.SP_EmployeePayRoll(String orgCode, Nullable
1 medicalallowcode, Nullable 1 houseRentallowcode, Nullable
1 homeLoanInterest, Nullable 1 sect80allowcode, Nullable
1 childallowcode, Nullable 1 mediclaimallowcode, Nullable
1 convallowcode, Nullable 1 miscellaneous, Nullable
1 fromMonthValue, Nullable 1 fromYearValue, Nullable
1 toMonthValue, Nullable 1 toYearValue, Nullable
1 startDateValue, Nullable`1 endDateValue) in F:\Pooja\OMS\OMS\OMS\OMS_data.Context.cs:line 185 at OMS .Service.ReportService.GetPayRollAllocationList() 在 F:\Pooja\OMS\OMS\OMS\Service\ReportService.cs:132 行
c# - SQL C#:Result.Read() 没有返回任何内容
当我使用此代码时,我得到 null 返回。但是当我尝试通过 sql 使用查询时,我得到了正常的结果。
这是我的代码:
返回字节[500]。有什么办法可以解决吗?谢谢!