我使用的DATAGRID组件,列出数据库的一个表里的所有数据。LINE这个列有1到16之间的随机数值,例如:
id line text
1 6 aa
2 1 aa
3 3 aa
4 8 aa
5 1 aa
6 2 aa
7 3 aa我需要在DATAGRID组件里按line里的所有的“1”先显示,再显示所有的“2”…………一直到“16”。请问有什么方法可以实现!!!
id line text
1 6 aa
2 1 aa
3 3 aa
4 8 aa
5 1 aa
6 2 aa
7 3 aa我需要在DATAGRID组件里按line里的所有的“1”先显示,再显示所有的“2”…………一直到“16”。请问有什么方法可以实现!!!
大概这个意思
SqlConnection con = DB.createCon();
con.Open();
SqlCommand cmd = new SqlCommand("select * from data_one where nday = '"+linelist.t1+"' ",con);
SqlDataAdapter sda = new SqlDataAdapter("select * from data_one where nday = '"+linelist.t1+"'",con);
DataSet ds = new DataSet();
sda.Fill(ds);
this.DataGrid1.DataSource = ds;
this.DataGrid1.DataBind();
con.Close();怎么改???这个代码是在LOAD里面的。
dv.Sort = (string)ViewState["SortField"] + " DESC"; score.DataSource = dv;
score.DataBind();