输入字符串格式不正确为什么? [英] Input string was not in a correct format why?

查看:80
本文介绍了输入字符串格式不正确为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

string loadHistoryID = CommonGet.GetDataRunHistoryID(Convert.ToInt32(sourceDefinitionId), item.FileName);
                xmlRecordList.Add(new StagingXML { CreateDateTime = DateTime.Now, CreateUser = "DataLoad", Data = item.XMLData, StagingLoadHistoryId = Convert.ToInt32(loadHistoryID), StagingRecordId = 1 });

推荐答案

您的 sourceDefinitionId 或您的 loadHistoryID 不是整数的有效字符串表示 - 所以使用调试器找出哪个。当你知道它里面有什么,你可以开始查看原因,并找出你需要什么类型的转换。



我们做不到 - 我们可以不要孤立地运行你的代码!
Either your sourceDefinitionId or your loadHistoryID is not a valid string representation of an integer - so use the debugger and find out which. When you know what is in it, you can start looking at why, and work out what type of conversion you need.

We can't do that - we can't run your code in isolation!


这篇关于输入字符串格式不正确为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆