SqlConnection conn = new SqlConnection("Data Source=WWW-DCE529843C0;Initial Catalog=sanfuyibiao;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
conn.Open();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from redianou";
SqlDataAdapter sda = new SqlDataAdapter();
sda.SelectCommand = cmd;
DataSet ds = new DataSet();
sda.Fill(ds, "redianou");
dataGridView1.DataSource = ds.Tables[0];
conn.Close();运行时dataGridView1不显示数据 空白的 谁能告诉下为什么? 另外 sda的fill方法不支持row_number()over(order by 。。) 怎么办?
SqlCommand cmd = new SqlCommand();
conn.Open();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from redianou";
SqlDataAdapter sda = new SqlDataAdapter();
sda.SelectCommand = cmd;
DataSet ds = new DataSet();
sda.Fill(ds, "redianou");
dataGridView1.DataSource = ds.Tables[0];
conn.Close();运行时dataGridView1不显示数据 空白的 谁能告诉下为什么? 另外 sda的fill方法不支持row_number()over(order by 。。) 怎么办?
dataGridView1.DataBind();
conn.Close();另外,如果你要进行排序,在SQL语句里操作就行了。至于Fill方法能不能进行排序,还没有研究过。
dataGridView1.DataBind();
conn.Close();另外,如果你要进行排序,在SQL语句里操作就行了。至于Fill方法能不能进行排序,还没有研究过。
dataGridView1.DataSource = ds.Tables[0];
dataGridView1.DataBind();
conn.Close();另外,如果你要进行排序,在SQL语句里操作就行了。至于Fill方法能不能进行排序,还没有研究过。
dataGridView1.DataBind();