问题描述
当我从访问数据网格视图中查看数据时
它只显示
数据表而不是条目记录
我尝试过:
con.Open()
Dim A As String
A = DateTime.Today.ToString(dd-MM-yyyy)
cmd =新OleDbCommand(选择*来自短信在哪里日期=+ A +)
cmd.Connection = con
dr =新OleDbDataAdapter(cmd)
dr.Fill(ds,sms)
DataGridView1.DataSource = ds.Tables(sms)
con.Close()
When I tring to retriew data from access to datagrid view
its showing only
data sheet but not entry records
What I have tried:
con.Open()
Dim A As String
A = DateTime.Today.ToString("dd-MM-yyyy")
cmd = New OleDbCommand("Select * From sms WHERE Date= " + A + "")
cmd.Connection = con
dr = New OleDbDataAdapter(cmd)
dr.Fill(ds, "sms")
DataGridView1.DataSource = ds.Tables("sms")
con.Close()
推荐答案
cmd = New OleDbCommand("Select * From sms WHERE Date >= ? ")
cmd.Connection = con
cmd.Parameters.AddWithValue("@DT", DateTime.Today)
这篇关于我无法在datagridview中看到数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!