I am currently doing a bank project which I could select the months of transaction history I want to view ( Eg: Current Month, Current Month n last 1 month ) Now, I only manage to retrieve all the transaction history I had using grid view. May I know how to view transactions for different period based on the radio button selected? I’m currently using asp.net n C#
myConnection.ConnectionString = strConnectionString;
SqlCommand cmd = new SqlCommand("SELECT thDate, thType, thAmountIn, thAmountOut from [Transaction]", myConnection);
myConnection.Open();
SqlDataReader reader1 = cmd.ExecuteReader();
GridView1.DataSource = reader1;
GridView1.DataBind();
For your SQL command you could try:
Where
RadioButtonList1is replaced by the name of your RadioButtonList. This should place the value of the selected radio button into the SQL statement.