M
mister-Ed
I need to look into a database table (cats) to see if a certain
category and its resulting resultset should be shown to users if it is
deemed "universal" , or the column 'ur' is tagged with the indicator
'univ' ( this is just a character datatype, but later will be changed
to a boolean true or false "bit" datatype because right now i'm just
working with one sole region) . But when i run the following sub and
subsequent block to check for "univ" , I don't get my script to
redirect to the page I indicate, it doesn't want to do a
response.redirect inside this block (???)
''''''''''''
<script runat="server">
Protected ur As string
Protected scate As string
Protected ssubcat as string
Protected scounty as string
Protected stown as string
'Handle page load event
Sub Page_Load(Sender As Object, E As EventArgs)
dim szone as string
scounty = request.querystring("county")
stown = request.querystring("town")
szone = request.querystring("bigzone")
scate = request.querystring("category")
ssubcat = request.querystring("subcat")
dim sqlcatchekstr as string
Dim MyConnection As SQLConnection
''Dim MyCommand As SQLDataAdapter
dim MyDataset As DataSet
dim MyTable As DataTable
sqlcatchekstr = "select category,subcategory,uregion from cats
where category ='" + scate + "'"
MyConnection = New SqlConnection("Data
Source=myserver.net;Initial Catalog=mydb;User Id=myid;Password=pwd;")
' Create a Command object with the SQL statement.
Dim Mycommand As New SqlCommand(sqlcatchekstr, Myconnection)
Myconnection.Open()
'init the reader
dim reader As SqlDataReader = MyCommand.ExecuteReader()
' Call Read before accessing data.
do While reader.Read()
ur = reader("uregion").ToString()
loop
reader.Close()
if ur = "univ" then
response.redirect("cat-universal.aspx?category=" & scate &
"&subcat=" & ssubcat & "&county=" & scounty & "")
end if
MyConnection.Close
End Sub
</script>
''''''''''''''''
thanks
ED
category and its resulting resultset should be shown to users if it is
deemed "universal" , or the column 'ur' is tagged with the indicator
'univ' ( this is just a character datatype, but later will be changed
to a boolean true or false "bit" datatype because right now i'm just
working with one sole region) . But when i run the following sub and
subsequent block to check for "univ" , I don't get my script to
redirect to the page I indicate, it doesn't want to do a
response.redirect inside this block (???)
''''''''''''
<script runat="server">
Protected ur As string
Protected scate As string
Protected ssubcat as string
Protected scounty as string
Protected stown as string
'Handle page load event
Sub Page_Load(Sender As Object, E As EventArgs)
dim szone as string
scounty = request.querystring("county")
stown = request.querystring("town")
szone = request.querystring("bigzone")
scate = request.querystring("category")
ssubcat = request.querystring("subcat")
dim sqlcatchekstr as string
Dim MyConnection As SQLConnection
''Dim MyCommand As SQLDataAdapter
dim MyDataset As DataSet
dim MyTable As DataTable
sqlcatchekstr = "select category,subcategory,uregion from cats
where category ='" + scate + "'"
MyConnection = New SqlConnection("Data
Source=myserver.net;Initial Catalog=mydb;User Id=myid;Password=pwd;")
' Create a Command object with the SQL statement.
Dim Mycommand As New SqlCommand(sqlcatchekstr, Myconnection)
Myconnection.Open()
'init the reader
dim reader As SqlDataReader = MyCommand.ExecuteReader()
' Call Read before accessing data.
do While reader.Read()
ur = reader("uregion").ToString()
loop
reader.Close()
if ur = "univ" then
response.redirect("cat-universal.aspx?category=" & scate &
"&subcat=" & ssubcat & "&county=" & scounty & "")
end if
MyConnection.Close
End Sub
</script>
''''''''''''''''
thanks
ED