Print Page | Close Window

Trying to assign result of query to a variable

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=24712
Printed Date: 28 March 2026 at 1:40pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Trying to assign result of query to a variable
Posted By: alistairhay
Subject: Trying to assign result of query to a variable
Date Posted: 29 October 2007 at 9:18pm
 know this sounds very basic, but it doesn't work the way I am used to coding web pages. First time I am using expression web.

I was to assign the result of a query to a variable so I can test the result, and if true, display something, if false, not display anything.

Query is this :

<asp:AccessDataSource runat="server" ID="VenueLookup" DataFile="App_Data/PublicHousePromotions.mdb"
SelectCommand="SELECT * FROM [Venue] WHERE ([venueCode] = ?)">
<SelectParameters>
<asp:querystringparameter Type="Int32" DefaultValue="1" Name="venueCode" QueryStringField="MyRef" />
</SelectParameters>
</asp:AccessDataSource>


What I am trying to do is this :

<script>
<%
Dim JoinedDate as String
JoinedDate = [venueDateSignedAgt]
if JoinedDate <> "" then
%>
<span class="style32">Joined:</span><asp:Label Text='<%# Bind("[venueDateSignedAgt]","{0:d}") %>' runat="server" id="lblJoined" Font-Names="Comic Sans MS" />
<br/>
<% end if %>
</script>


Any help would be hugely appreciated.



Replies:
Posted By: jamie.townsend
Date Posted: 14 December 2007 at 8:17pm
For starters the script does not have runat="server"
Did you get this working in the end ?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net