当我使用代码创建dataset
时,为什么它不会在gridview
上显示它。我做错了什么或者整个这是错误的。仍在努力在没有数据库的情况下显示报告图表。
Public Class Form1
Private m_DataSet As DataSet
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
m_DataSet = New DataSet("DataCLicks")
Dim dt_Clicks As New DataTable("TableClicks")
m_DataSet.Tables.Add(dt_Clicks)
dt_Clicks.Columns.Add("W_Clicks", GetType(Integer))
dt_Clicks.Columns.Add("S_Clicks", GetType(Integer))
Dim clicks_data(1) As Object
clicks_data(0) = 150
clicks_data(1) = 220
dt_Clicks.Rows.Add(clicks_data)
DataGridView1.DataSource = m_DataSet
End Sub
结束班