DataTable dt = new DataTable();
using (SqlConnection conn = new SqlConnection("连接字符串"))
{
using (SqlCommand cmd = new SqlCommand("sql语句", conn))
{
conn.Open();
new SqlDataAdapter(cmd).Fill(dt);
}
}
datagridview.DataSource = dt;
里面嵌入的是个下拉框 Combox,模板里面可以编辑