是否有可能针对 datagridview 或 gridview 运行 SQL 语句?
问问题
62 次
3 回答
0
You can make like this>>
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView1.AllowUserToAddRows = false;
dataGridView1.AllowUserToDeleteRows = false;
dataGridView1.AllowUserToOrderColumns = true;
dataGridView1.ReadOnly = true;
dataGridView1.MultiSelect = false;
dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None;
dataGridView1.AllowUserToResizeColumns = false;
dataGridView1.ColumnHeadersHeightSizeMode =
DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
dataGridView1.AllowUserToResizeRows = false;
dataGridView1.RowHeadersWidthSizeMode =
DataGridViewRowHeadersWidthSizeMode.DisableResizing;
You can add columns by dataGridView1.Columns["CompanyName"].ReadOnly = true;
Can refer this>>http://msdn.microsoft.com/en-us/library/cze614bb.aspx
Or simply another way is keep your database table name and gridview name same.
于 2013-03-22T09:40:59.453 回答
0
No. But you can try using LINQ to objects instead.
于 2013-03-22T09:41:23.107 回答
0
于 2013-03-22T10:05:03.220 回答