我正在尝试使用VS 2008中的datagridview显示从sql数据库中检索到的数据集.但我需要垂直而不是水平显示数据.这就是我一开始就做的.
con.Open();
SqlCommand cmd = new SqlCommand("proc_SearchProfile", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@scute_id", SqlDbType.VarChar, (10)).Value = val;
SqlDataAdapter adapt = new SqlDataAdapter(cmd);
DataSet dset = new DataSet();
adapt.Fill(dset, "Profile");
this.dataGridView1.DataSource = dset;
this.dataGridView1.DataMember = "Profile";
Run Code Online (Sandbox Code Playgroud)
我搜索并阅读了一些线程,但没有一个工作.任何人都可以帮我垂直显示数据网格中的检索数据吗?