datagrid的问题
我在窗口中放置了一个DATAGRID,在程序中用代码控制让它显示表CLASS中字段DID=001 的记录。代码如下:
string _strcon = @"provider=microsoft.jet.oledb.4.0;data source=e:\example\students\db\department.mdb";
OleDbConnection myconn = new OleDbConnection(_strcon);
string str = "select * from class where did='001' ";
myconn.Open();
OleDbDataAdapter mycommand = new OleDbDataAdapter(str, myconn);
DataSet setobj = new DataSet();
adobj = new OleDbDataAdapter(str, myconn );
adobj.Fill (setobj,"class" );
this.dataGrid1.DataSource = setobj.Tables ["class"];
表中的字段是英文 的,我现在想让DATAGRID在显示表中数据时,列名变成中文的,我该在怎么做哇?谢谢了!!!!!!!
我在窗口中放置了一个DATAGRID,在程序中用代码控制让它显示表CLASS中字段DID=001 的记录。代码如下:
string _strcon = @"provider=microsoft.jet.oledb.4.0;data source=e:\example\students\db\department.mdb";
OleDbConnection myconn = new OleDbConnection(_strcon);
string str = "select * from class where did='001' ";
myconn.Open();
OleDbDataAdapter mycommand = new OleDbDataAdapter(str, myconn);
DataSet setobj = new DataSet();
adobj = new OleDbDataAdapter(str, myconn );
adobj.Fill (setobj,"class" );
this.dataGrid1.DataSource = setobj.Tables ["class"];
表中的字段是英文 的,我现在想让DATAGRID在显示表中数据时,列名变成中文的,我该在怎么做哇?谢谢了!!!!!!!