我在导入数据到datagridview时出现问题。 我有94个数据行,我想添加到datagridview,但是当涉及40 datarow时,我得到一个错误:
对象引用未设置为对象的实例。
window.crypto.signtext
请有人可以帮助我吗?
这是40结果:
var result = ia.Rows.Select(
r => new
{
ItemID = r.ItemId,
Title = r.Title,
Code = r.Code,
UnitOfMeasurement = r.UnitOfMeasurement,
ItemType = r.ItemType,
VatRate = r.VatRate.Name,
Price = r.Price,
Currency = r.Currency.Name,
RevenueAccountDomestic = r.RevenueAccountDomestic.ID,
RevenueAccountOutsideEU = r.RevenueAccountOutsideEU.ID,
RevenueAccountEU = r.RevenueAccountEU.ID,
}).ToList();
b.DataSource = result;
dataGridView1.DataSource = b;
这里是第一个可以进入gridview的结果
Code "#13011" string
Currency {Api.mMApiFkField} Api.mMApiFkField
ItemId 2700453 int
ItemType "A" string
Name null string
PageSize 0 long
Price 0.0 double
RebatePercent 0.0 double
RevenueAccountDomestic null Api.RevenueAccountDomestic
RevenueAccountEU null Api.RevenueAccountEU
RevenueAccountOutsideEU null Api.RevenueAccountOutsideEU
Rows null System.Collections.Generic.List<Api.ItemsPage>
RowVersion null string
StocksAccount null object
Title "Plačano po predračunu" string
UnitOfMeasurement null string
Usage null string
VatRate {Api.mMApiFkField} Api.mMApiFkField