使用DateGridView显示表所有信息
2012-05-31 14:55
239 查看
获取视图ViewTBook的所有信息
/// <summary> /// 获取所有信息 /// </summary> /// <returns></returns> public DataSet GetAllBook() { string sql = "select * from ViewTBook"; cmd.CommandText = sql; DataSet myDS = new DataSet(); SqlDataAdapter sda = new SqlDataAdapter(cmd); sda.Fill(myDS); return myDS; }
DateGridView显示代码
因为上面代码写在BookDAL类里,所以这里要先实例
BookDAL bookdal = new BookDAL(); DataSet myDS = new DataSet(); myDS= bookdal.GetAllBook(); this.dataGridView1.DataSource = myDS.Tables[0].DefaultView;
相关文章推荐
- 51ditu maps API 使用——显示所有信息——点击链接显示对应标记浮窗[修]
- Ubuntu 使用 nmcli 显示网络的所有信息
- 显示当前用户所拥有的表&当前用户可以访问的所有表&数据库中的所有表&当前用户信息&当前用户所能管理的用户&数据库中所拥有的用户
- Swift - 使用PhotoKit获取照片1(获取所有照片缩略图、原图及其信息)
- 使用Toast显示提示信息框
- 获取所有应用程序的信息 显示并打开相关的程序
- BCG中使用状态栏显示状态信息
- 当使用restore .bak文件的时候.显示如信息:Use WITH MOVE to identify a valid location for the file
- PHP捕捉错误并显示友好信息的方法(不使用try...catch)
- android开发-使用Toast显示提示信息框
- 基于地图开发控件GMap.Net 使用 (六) 中文显示详细街道数据信息
- 使用Visifire+ArcGIS API for Silverlight实现Graphic信息的动态图表显示
- django sql_queries 模板中显示所有的sql查询调试信息
- #调整随机森林的参数(调整n_estimators随机森林中树的数量默认10个树,精度递增显著,但并不是越多越好),加上verbose=True,显示进程使用信息
- 使用update!导致的更新时候的错误信息不显示 ruby on rails
- 使用ListView显示信息列表,用监听器和适配器,操作
- MySQL入门--登陆数据库、显示客户端的所有数据库、使用指定数据库、显示指定数据库中的所有数据表、
- 使用树控件显示文件夹下的所有的文件
- 使用ToolTip控件显示提示信息
- 5使用XmlDocument将dropdownlist中显示的书名的其它信息读入到相应的文本框中。