首页 新闻 赞助 找找看

oracle中的number类型转成c#的int,发生指定的转换无效错误

0
悬赏园豆:20 [已解决问题] 解决于 2016-01-28 14:09

代码如下:

ProjectCompanyInfo companyinfo = new ProjectCompanyInfo();
DataTable dt=Helper.GetProjectCompnayInfo();
var Datas = (from t in dt.AsEnumerable()
select new ProjectCompanyInfo{ //这里报指定的转换无效错误
CompanyId = Convert.ToInt32(t.Field<int>("CompanyId")),
CompanyName = t.Field<string>("CompanyName"),
IndustryType = t.Field<string>("IndustryType"),
RepDate = t.Field<string>("RepDate"),
RegCapital = t.Field<string>("RegCapital"),
CompanyArea = t.Field<string>("CompanyArea"),
RelocationAddress = t.Field<string>("RelocationAddress"),
RegAdress = t.Field<string>("RegAdress"),
LinkMan = t.Field<string>("LinkMan"),
ContractPhone = t.Field<string>("ContractPhone"),
CompanyIntroduction = t.Field<string>("CompanyIntroduction"),
Year = t.Field<string>("Year"),
ApplyState = Convert.ToInt32(t.Field<int>("ApplyState")),
Nat_Org_Code = t.Field<string>("Nat_Org_Code")
}).ToList();
、朔风的主页 、朔风 | 初学一级 | 园豆:151
提问于:2016-01-28 11:41
< >
分享
最佳答案
2

oracle的number->c#的decimal

收获园豆:20
jello chen | 大侠五级 |园豆:7306 | 2016-01-28 13:01

谢谢你,

、朔风 | 园豆:151 (初学一级) | 2016-01-28 14:09
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册