datagridview无数据显示问题处理
来源:互联网 发布:威斯特伐利亚和约知乎 编辑:程序博客网 时间:2024/06/06 15:00
1.if (dataGridView1.Rows.Count < 1) return;
int index = dataGridView1.CurrentRow.Index; //获取当前选中行索引号
dataGridView1.Rows[index].Selected = true; //加亮显示
string Inven_No = this.dataGridView1["InventoryNo", index].Value.ToString();
2.if (ds.Tables["tb"].Rows.Count == 0)
{ MessageBox.Show("没有符合条件的数据"); }
3.
OracleDataAdapter da = new OracleDataAdapter(strSQL, conn);
ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count == 0)
{
MessageBox.Show("没有符合条件的数据");
}
da.Dispose();
this.bindingSource1.DataSource = ds.Tables[0];
this.bindingNavigator1.BindingSource = bindingSource1;
this.dataGridView1.DataSource = bindingSource1;
this.dataGridView1.DefaultCellStyle.SelectionBackColor = Color.LightSteelBlue;
this.dataGridView1.DefaultCellStyle.SelectionForeColor = Color.Black;
- datagridview无数据显示问题处理
- 关于DataGridView显示数据问题。
- Datagridview数据显示问题查错
- DataGridView 如何显示数据
- DataGridView显示、更新数据
- dataGridView分页显示数据
- DataGridView显示数据
- datagridview显示问题
- 关于GridView的无数据显示问题..
- DataGridView绑定数据时,时间格式显示不全的问题
- Winform控件之DataGridView数据控件显示问题
- DataGridView绑定数据时,时间格式显示不全问题
- DataGridView实现分页显示数据
- DataGridView数据显示到Excel
- winform DataGridView 分页显示数据
- 通过DataGridView分段显示数据
- 通过DataGridView分段显示数据
- 隐藏DataGridView中无数据的列
- withdjango
- Cookie和Session-----会话跟踪中的两个重要技术
- SQL Cookbook学习笔记-使用数字
- 基于SS框架的留言本前台控制器
- cygwin的部署
- datagridview无数据显示问题处理
- 基于SS框架的留言本后台控制器
- 下个阶段的计划
- 统计数据库所有表空间统计结果
- Android获得标题栏和状态栏高度,以及立即获取控件的高度
- jQuery下获取浏览器、可视范围及其他的各种宽高
- 使用JNI,让java调用c代码
- oracle 11.2.0.2 所有平台下载地址
- 全面学习AP应用程序和驱动程序开发C&C++