如题
解决方案 »
- 连接数据库插入值
- 在线等。。如何实现DropDownList里面的某一项内容不可用,变为灰色,不可点击,但不删除
- 指点一下三层框架
- visual sourcesafe 2005 所有人签入后IIS不能反应出最新版本
- 求教:为何自定义IHttpAsyncHandler中无法异步context.Server.Execute
- access中的自增列的值,应该用什么命令来获取?
- 我快疯了!用尽了论坛里提到的方法还是没搞定这个不能刷新的问题
- 请问论坛中的消息是如何实现的?
- 请问e.cancel=true起什么作用?(标题说不清,详见内容)
- 如何把字符串 "2+3" 转成数学表达式 2+3?
- 如何读取动态控件的值?
- 请问如何用ASP.NET页面改变系统时间?(有管理员权限的情况下)
右击你的DataGrid,属性设置,然后 DataGrid.source = Dataset
// Create a DataView using the DataTable.
DataTable myTable = new DataTable("Suppliers");
// Insert code to create and populate columns.
DataView myDataView = new DataView(myTable);
myGrid.DataSource = myDataView;
}
private void BindToDataSet(DataGrid myGrid){
// Create a DataSet.
DataSet myDataSet = new DataSet("myDataSet");
// Insert code to populate DataSet with several tables.
myGrid.DataSource = myDataSet;
// Use the DataMember property to specify the DataTable.
myGrid.DataMember = "Suppliers";
}
private DataView GetDataViewFromDataSource(){
// Create a DataTable variable, and set it to the DataSource.
DataView myDataView;
myDataView = (DataView) dataGrid1.DataSource;
return myDataView;
}
private DataSet GetDataSetFromDataSource(){
// Create a DataSet variable, and set it to the DataSource.
DataSet myDataSet;
myDataSet = (DataSet) dataGrid1.DataSource;
return myDataSet;
}