Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# MySqlCommand.ExecuteReader()在初始化时引发System.Format异常_C#_Mysql_Guid - Fatal编程技术网

C# MySqlCommand.ExecuteReader()在初始化时引发System.Format异常

C# MySqlCommand.ExecuteReader()在初始化时引发System.Format异常,c#,mysql,guid,C#,Mysql,Guid,所以我尝试使用MySqlDataReader从我的数据库中获取数据。我知道数据库实际上会响应(插入、删除和更新程序中的所有工作) 问题似乎不在命令本身,因为该命令在MySQL工作台中工作。无论如何,在执行这行代码时 using (MySqlConnection conn = new MySqlConnection(connectionString)) VS调试器注意到引发了以下异常 System.FormatException未由用户代码处理 HResult=-2146233033 Messa

所以我尝试使用MySqlDataReader从我的数据库中获取数据。我知道数据库实际上会响应(插入、删除和更新程序中的所有工作)

问题似乎不在命令本身,因为该命令在MySQL工作台中工作。无论如何,在执行这行代码时

using (MySqlConnection conn = new MySqlConnection(connectionString))
VS调试器注意到引发了以下异常

System.FormatException未由用户代码处理
HResult=-2146233033 Message=Guid应包含32位数字和4 破折号(xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)。Source=mscorlib
堆栈跟踪: 位于System.Guid.TryParseGuidWithNoStyle(字符串guidString、GuidResult和result) 在System.Guid.TryParseGuid(字符串g、GuidStyles标志、GuidResult和result) at System.Guid..ctor(字符串g) 位于MySql.Data.Types.MySqlGuid.MySql.Data.Types.IMySqlValue.ReadValue(MySqlPacket 数据包,Int64长度,布尔值为nullVal) 位于MySql.Data.MySqlClient.NativeDriver.ReadColumnValue(Int32索引,MySqlField字段,IMySqlValue valObject) 位于MySql.Data.MySqlClient.Driver.ReadColumnValue(Int32索引,MySqlField字段,IMySqlValue) 位于MySql.Data.MySqlClient.ResultSet.ReadColumnData(布尔输出参数) 位于MySql.Data.MySqlClient.ResultSet.NextRow(CommandBehavior) 在MySql.Data.MySqlClient.MySqlDataReader.Read()处 位于d:\repositories\x0848199\PS11\ToDoService\BoggleService.svc.cs:行中的ToDoList.BoggleService.GetBriefStatus(字符串gameToken) 443 在SyncInvokeGetBriefStatus处(对象,对象[],对象[]) 位于System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(对象 实例、对象[]输入、对象[]和输出) 在System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc)中& rpc)内部异常:

真的不确定为什么它会告诉我guid格式,因为我在这段代码中没有使用guid。

如有任何帮助,我们将不胜感激。

看来,添加
;旧的guids=true解决了问题

似乎附加了
;旧的guids=true解决了问题

似乎附加了
;旧的guids=true解决了问题

似乎附加了
;旧的guids=true解决了问题

你能在cs3500_u0848199.PairedGames表中发布所有列的列和数据类型吗?同时显示代码块,包括行:
BoggleService.svc.cs:line 443
,以及在该行k上调用中使用的任何类的声明,以便在成对游戏GameToken char(36)Player2Token char(36)中显示列和数据类型Score1 int(11)Score2 int(11)Board char(16)Duration int(11)StartTime bigint(20)@Ron beyert包含行BoggleService.svc.cs的代码块:行443已经在我原来的帖子中了。第443行是while(reader.Read())行。我认为,相关声明已包含在原始帖子中。如果我错了,请告诉我我误解了什么@Alex错误消息似乎表明它被键入的
Guid
阻塞,该Guid包含未格式化为
Guid
的内容。您可以发布cs3500_u0848199.PairedGames表中所有列的列和数据类型吗?还显示代码块,包括行:
BoggleService.svc.cs:line 443
和对该行调用中使用的任何类的声明,因此成对游戏中的列和数据类型GameToken char(36)Player2Token char(36)Score1 int(11)Score2 int(11)Board char(16)Duration int(11)StartTime bigint(20)@Ron beyer包括行BoggleService.svc.cs:line 443的代码块已经在我的原始帖子中。第443行是while(reader.Read())行。我认为,相关声明已包含在原始帖子中。如果我错了,请告诉我我误解了什么@Alex错误消息似乎表明它被键入的
Guid
阻塞,该Guid包含未格式化为
Guid
的内容。您可以发布cs3500_u0848199.PairedGames表中所有列的列和数据类型吗?还显示代码块,包括行:
BoggleService.svc.cs:line 443
和对该行调用中使用的任何类的声明,因此成对游戏中的列和数据类型GameToken char(36)Player2Token char(36)Score1 int(11)Score2 int(11)Board char(16)Duration int(11)StartTime bigint(20)@Ron beyer包括行BoggleService.svc.cs:line 443的代码块已经在我的原始帖子中。第443行是while(reader.Read())行。我认为,相关声明已包含在原始帖子中。如果我错了,请告诉我我误解了什么@Alex错误消息似乎表明它被键入的
Guid
阻塞,该Guid包含未格式化为
Guid
的内容。您可以发布cs3500_u0848199.PairedGames表中所有列的列和数据类型吗?还显示代码块,包括行:
BoggleService.svc.cs:line 443
和对该行调用中使用的任何类的声明,因此成对游戏中的列和数据类型GameToken char(36)Player2Token char(36)Score1 int(11)Score2 int(11)Board char(16)Duration int(11)StartTime bigint(20)@Ron beyer包括行BoggleService.svc.cs:line 443的代码块已经在我的原始帖子中。第443行是while(reader.Read())行。我认为,相关声明已包含在原始帖子中。如果我错了,请告诉我我误解了什么@Alex错误消息似乎表明它被键入的
Guid
阻塞,该Guid包含未格式化的内容
using (MySqlConnection conn = new MySqlConnection(connectionString))