SqlCommand selectCmd = new SqlCommand("select * from tab1", conn);
SqlDataReader drd = selectCmd.ExecuteReader();
control1.DataSource = drd;
//control1.DataTextField = "name";
//control1.DataValueField = "id";
control1.DataBind();
drd.Close()
SqlCommand selectCmd = new SqlCommand("select * from tab1", conn);
SqlDataReader drd = selectCmd.ExecuteReader();
while(drd.Read())
{
Convert.ToString(drd.GetValue(1));
}
drd.Close()
OleDbCommand selectCmd = new OleDbCommand("select * from tab1", conn);
OleDbDataAdapter da = new OleDbDataAdapter(selectCmd);
DataSet ds = new DataSet();
da.Fill(ds, "tab1");
control1.DataSource = ds.Tables[0];
control1.DataBind();
OleDbCommand insertCmd = new OleDbCommand("insert into tab1(id, name) value(1, 'aaa')", conn);
insertCmd.ExecuteNonQuery();
OleDbCommand updateCmd = new OleDbCommand("update tab1 set id=2,name='aaa' where id=1", conn);
updateCmd.ExecuteNonQuery();
OleDbCommand deleteCmd = new OleDbCommand("delete from tab1 where id=1", conn);
deleteCmd.ExecuteNonQuery();