ドロップダウンリストに基づいてグリッドビューを表示する必要があります:LastestTransactionFirst、EarlierTransactionFirst。つまり、基本的には、gridviewの日付に基づいたdescまたはascです。どうすればいいですか?
これは、グリッドビューを選択するための私のコードです。しかし、ドロップダウンリストがあり、ドロップダウンリストの選択に基づいてグリッドビューを表示する必要があります。
myConnection.ConnectionString = strConnectionString;
SqlCommand cmd = new SqlCommand("SELECT thDate, thType, thAmountIn, thAmountOut from [Transaction] ORDER BY thDate, thType, thAmountIn, thAmountOut DESC", myConnection);
myConnection.Open();
SqlDataReader reader1 = cmd.ExecuteReader();
GridView1.DataSource = reader1;
GridView1.DataBind();