DataGrid.Columns[0].Visiable=false;
private void GetPrimaryKeys(DataTable table)
{
// Create the array for the columns.
DataColumn[] columns;
columns = table.PrimaryKey;
// Get the number of elements in the array.
Console.WriteLine("Column Count: " + columns.Length);
for(int i = 0; i < columns.Length; i++)
{
Console.WriteLine(columns[i].ColumnName + columns[i].DataType);
}
}
http://msdn.microsoft.com/zh-cn/library/system.data.datatable.primarykey%28VS.80%29.aspx
<asp:BoundColumn DataField="content" Visible="false" HeaderText="txtContent"></asp:BoundColumn>