刚刚接触multirow,使用vs软件,multirow版本是最新的,之前看到网上的答案很多都不能用了。
我手动建了datatable,里边有十多条数据,想把它插入到multirow中,但是插入的时候只能插进去一条。我想让它一查询全都显示出来。请问一下该怎么写。挺急的
下边是具体的代码,太多了挑出几行来,帮忙看看我该怎么写,是不是哪里错了
Dim DTForNow As New DataTable
With DTForNow
.Columns.Add("SHOHIN_CD", GetType(Int32))
.Columns.Add("SHOHIN_NM", GetType(String))
.Columns.Add("ZEI_KBN", GetType(String))
.Columns.Add("GENKA_ZEIKOMI", GetType(Double))
.Columns.Add("GENKA_ZEINUKI", GetType(Double))
.Columns.Add("BAIKA", GetType(Double))
End With
Dim row As DataRow = DTForNow.NewRow
If txtShoBunruiCD.Text = "100" Then
row = DTForNow.NewRow
row("SHOHIN_CD") = 100
row("SHOHIN_NM") = "sikeda"
row("ZEI_KBN") = "1:税込み"
row("GENKA_ZEIKOMI") = 108000.0
row("GENKA_ZEINUKI") = 100000.0
row("BAIKA") = 110000
DTForNow.Rows.Add(row)
End If
If txtShoBunruiCD.Text = "200" Then
row = DTForNow.NewRow
row("SHOHIN_CD") = 200
row("SHOHIN_NM") = "aodi"
row("ZEI_KBN") = "2:税抜き"
row("GENKA_ZEIKOMI") = 216000.0
row("GENKA_ZEINUKI") = 200000.0
row("BAIKA") = 210000
DTForNow.Rows.Add(row)
End If
'bang 定
Dim ds As DataSet = New DataSet()
mgrdMeisaiList.DataSource = DTForNow
mgrdMeisaiList.DataSource.Rows.Add(DTForNow.NewRow)
|
|