如何隐藏winform中DataGrid的列 可以隐藏,如下:http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q708q 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://lucky_elove.www1.dotnetplayground.com/ http://expert.csdn.net/Expert/topic/1618/1618445.xml?temp=.8810846 string conStr = @"Provider=Microsoft.JET.OLEDB.4.0;data source=C:\northwind.mdb"; string sqlStr = "SELECT * FROM Employees"; // Create connection object OleDbConnection conn = new OleDbConnection(conStr); // Create data adapter object OleDbDataAdapter da = new OleDbDataAdapter(sqlStr,conn); // Create a dataset object and fill with data using data adapter's Fill method DataSet ds = new DataSet(); da.Fill(ds, "Employees"); // Hide the column and attach dataset's DefaultView to the datagrid control ds.Tables["Employees"].Columns["LastName"].ColumnMapping = MappingType.Hidden; dataGrid1.DataSource = ds.Tables["Employees"]; // Hide the column and attach dataset's DefaultView to the datagrid control ds.Tables["Employees"].Columns["LastName"].ColumnMapping = MappingType.Hidden; dataGrid1.DataSource = ds.Tables["Employees"]; ds.Tables["Employees"].Columns["LastName"].ColumnMapping = MappingType.Hidden; 如何判断usb口插入的设备是wince设备 从OLE字段读文本和图片到指定窗体 winsock 【】请教达人:关于winform datagridView userControl问题?【】 c# 操作VSS Win7下不能用 如何让控件的大小与窗体大小成等比放大或缩小 按纽 TEXT和BackgroundImage @@@@@@从文件中读出的内容怎样直接帮定到grid中?@@@@@ DataReader怎样判断是否为空啊? 虚心请教 请问谁看过wrox的《c#数据库入门经典》这本书?怎么样啊? dataSet占用的内存也太大了!随便一点数据就好几兆!
string sqlStr = "SELECT * FROM Employees";
// Create connection object
OleDbConnection conn = new OleDbConnection(conStr);
// Create data adapter object
OleDbDataAdapter da = new OleDbDataAdapter(sqlStr,conn);
// Create a dataset object and fill with data using data adapter's Fill method
DataSet ds = new DataSet();
da.Fill(ds, "Employees");
// Hide the column and attach dataset's DefaultView to the datagrid control
ds.Tables["Employees"].Columns["LastName"].ColumnMapping = MappingType.Hidden;
dataGrid1.DataSource = ds.Tables["Employees"];
// Hide the column and attach dataset's DefaultView to the datagrid control
ds.Tables["Employees"].Columns["LastName"].ColumnMapping = MappingType.Hidden;
dataGrid1.DataSource = ds.Tables["Employees"];