I'm trying to display set of data which have retrieved from the sql database using a datagridview in VS 2008. But I need to display data vertically rather than horizontally. This is what I have done at the beginning.
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";
I searched and read a few threads but none of those work. Can anyone help me on displaying retrieved data in a datagridview vertically?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…