473,324 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

filter results of hyperlinked page

i have a 2 column datagrid (account_id, account). the second is a hyperlink
column with a URL Column account_id and a URL Format String
EnterTargets.aspx?id={0}. It looks like it's passing the variable (if that's
the right terminology) to the new page. The new page ends
/EnterTargets.aspx?id=14031. so, my problem is, how to use that variable on
the page?

the page loads a dropdown list with the months of the year in it (MonthID,
MonthDesc), and defaults to january. i have a datagrid on the page
/EnterTargets that's supposed to pull data from a sql table and show only
data for the month in the dropdown and related to account 14031 in this
case. i think the month code works but i'm to sure what to write to pass the
variable from the prior page. i'm stuck. any help would be great! thanks! My
code for the datagrid is:

Private Sub BindData(ByVal _ID As String)
Dim _SqlTargets As String = "Select account_id, category_id,
month_id, goal_dollars from goals_test where month_id = " & _ID
Dim _Ds As New DataSet
Dim _SqlConnection As New SqlConnection(strConn)
Dim _SqlCommand As New SqlCommand(_SqlTargets, _SqlConnection)
Dim _SqlDataAdapter As New SqlDataAdapter(_SqlCommand)
_SqlConnection.Open()
_SqlDataAdapter.Fill(_Ds)
DataGrid1.DataSource = _Ds
DataGrid1.DataBind()
End Sub
Nov 21 '05 #1
1 1026
Ooops. Here's the click event that's supposed to display the datagrid. I was
actually hoping to have the datagrid display on the page load, but i don't
know how to do that yet...next week maybe...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim strMonth_ID As String = ddlMonth.SelectedValue
BindData(strMonth_ID)
End Sub

"Mike C" wrote:
i have a 2 column datagrid (account_id, account). the second is a hyperlink
column with a URL Column account_id and a URL Format String
EnterTargets.aspx?id={0}. It looks like it's passing the variable (if that's
the right terminology) to the new page. The new page ends
/EnterTargets.aspx?id=14031. so, my problem is, how to use that variable on
the page?

the page loads a dropdown list with the months of the year in it (MonthID,
MonthDesc), and defaults to january. i have a datagrid on the page
/EnterTargets that's supposed to pull data from a sql table and show only
data for the month in the dropdown and related to account 14031 in this
case. i think the month code works but i'm to sure what to write to pass the
variable from the prior page. i'm stuck. any help would be great! thanks! My
code for the datagrid is:

Private Sub BindData(ByVal _ID As String)
Dim _SqlTargets As String = "Select account_id, category_id,
month_id, goal_dollars from goals_test where month_id = " & _ID
Dim _Ds As New DataSet
Dim _SqlConnection As New SqlConnection(strConn)
Dim _SqlCommand As New SqlCommand(_SqlTargets, _SqlConnection)
Dim _SqlDataAdapter As New SqlDataAdapter(_SqlCommand)
_SqlConnection.Open()
_SqlDataAdapter.Fill(_Ds)
DataGrid1.DataSource = _Ds
DataGrid1.DataBind()
End Sub

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Frank | last post by:
I have a navigation bar that is included in a series of pages throughout the site, using the <!-- #include file=""--> method. The bar has a black background, and I'd like the hyperlinked text on...
1
by: Edward Burns | last post by:
I am trying to create an events calendar with a complete month view. I want to be able to get all the events for a particular month, using only one recordset on the page then be able to loop...
0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
0
by: phil-news-nospam | last post by:
I was experimenting with buttons in HTML/CSS and encountered some strange behaviour when changing the padding property setting in the stylesheet. Maybe it's not a stylesheet issue, but since that's...
6
by: supasnail | last post by:
I've been going round in circles here trying to get this to work and my ignorance of ASP is now showing me up. I want to construct a query string to allow me to filter entries to be displayed on...
4
by: gregjgman | last post by:
I'm looking for some code (html, javascript or otherwise) that I can embed into my web site so that when the user clicks on one button, they can send all hyperlinked documents on the page to a...
1
by: noor1234 | last post by:
Hi, My gridview should have columns containing both hyperlinked and non hyperlinked cells in the same column. Example - Say there are 4 rows and 4 columns in my grid, and the 3rd column should...
1
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
1
by: woodey2002 | last post by:
Hi Everyone and many thanks for your time.. I am trying to begin access and a bit of VBA i am enjoying it but I have a annoying problem I just can’t get any where on. My databse mostly includes...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.