掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
可変長の2次元を配列をRedimなしで使うには (ID:140193)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
こちらは DataView 版。やっている事は同じ…。 Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load Dim ds As DataSet = CreateSampleData() Dim table1 As DataTable = ds.Tables("Table1") Dim view1 As New DataView(table1) view1.Sort = "日付 ASC" Dim preDate As Date = Date.MaxValue Dim msg As New System.Text.StringBuilder() Dim count As Integer = 0 For Each row As DataRowView In view1 Dim curDate As Date = CDate(row.Row("日付")) If preDate <> curDate Then preDate = curDate Dim view2 As New DataView(table1) view2.RowFilter = String.Format("日付=#{0:MM/dd/yyyy}#", curDate) msg.AppendLine(String.Format(" {0:yyyy/MM/dd}={1:#,0}件", curDate, view2.Count)) count += 1 End If Next msg.Insert(0, String.Format("グループ化総件数:{0}件", count) & vbNewLine, 1) MessageBox.Show(msg.ToString()) End Sub
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.