I have a page status.aspx that contains several buttons such as 30 days, 60 days & 90 days. I would like to pass the parameters to my existing gridview depending on which button has been clicked. My code behide for the gridview as follows:
Dim cmd As SqlCommand = New SqlCommand("up_AcctStatus", conn)
cmd.CommandType = CommandType.StoredProcedure
Dim paramNumOfDays As New SqlParameter("@NumOfDays", SqlDbType.Int)
paramNumOfDays.Value = "??? 30, 60 or 90 ???"
cmd.Parameters.Add(paramNumOfDays)
GridView1.DataSource = cmd.ExecuteReader()
GridView1.DataBind()
If you don’t want to use any ORM but sqlComand you can:
vb: