mysql - VB.net DataGridView not display the Data from MySql Data base
问题描述
I am trying to display the data from MySql database
using DataGridView
DataSource
and MySqlDataAdapter
filling a DataTable
.
Then the data goes into the DataGridView
. I do not know what is the problem, everything seems right and my code is correct, but nothing is being displayed on my DataGridView
.
Try
Me.DataGridViewp.DataSource = Nothing
ConnDB()
sqL = "SELECT picture FROM product"
cmd = New MySqlCommand(sqL, conn)
Dim dtSample As New DataTable
Dim daSample As New MySqlDataAdapter(cmd)
daSample.Fill(dtSample)
Me.DataGridViewp.DataSource = dtSample
conn.Close()
conn.Dispose()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
解决方案
推荐阅读
- wordpress - 向 WordPress 插件发送的电子邮件添加附件
- javascript - 过滤对象数组,其中对象中的一个字段是数组
- javascript - 验证表单是否已完全提交
- django - Django - 时间场差异
- php - 试图让 PHP 流与 Thawte TLS RSA CA G1 一起工作 - 内部错误
- visual-studio-code - 缺少导入时如何从 VS Code 创建文件
- javascript - 在某些拒绝案例中,我如何打破我的承诺链
- quartz.net - Quartz.net - 我应该手动删除安排为一次性执行的作业吗?
- python - 如何对同一文本样本中的不同主题/方面进行情感分析
- android - WearOS 中 SensorManager 的问题