[求助]数据库问题
private void button1_Click(object sender, System.EventArgs e){
n=new System.Data.OleDb.OleDbConnection();
n.ConnectionString= @"Provider=Microsoft.Jet.OLEDB.4.0;" +@"Data source= C:\Documents and Settings\Administrator\桌面\net\Access练习\WindowsApplication1\bin\Debug\罗斯文商贸.mdb";
n.Open();
MessageBox.Show("数据库已连接");
if(da==null)
{
da=new OleDbDataAdapter();
}
if(cmd==null)
{
cmd=new OleDbCommand();
cmd.Connection=n;
cmd.CommandType=CommandType.Text;
cmd.CommandText="SELECT * FROM 雇员";
}
da.SelectCommand=cmd;
if(ta==null)
{
ta=new DataTable();
da.Fill(ta);
this.dataGrid1.DataSource=ta;
}
n.Close();
}
比如我拖一个文本框,怎么把数据库里某个值赋给文本框呀? 请赐教~