Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 10th, 2007, 07:10 AM
Authorized User
 
Join Date: Mar 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default If SQL value = something then

Hello People, wonder if you can help with this one. Only been at this a couple of weeks so please forgive if its a simple question, only I have gone completely braindead now.

Using:
SQL 2000
Visual Studio 2005
In VB

I have a first page where the user enters a name. On clicking search this name is passed to a second page in the url.

Second page does a lookup in the db using querystring("id") in the url and returns the values to formview

What I need it to do is before it posts to the form do a second check to find what package they have and post the details accordingly.

So what I thought was an IF THEN ELSE statement

IF [Package] = 4 Then
Else IF [Package] = 3 Then

Etc etc
Only I dont know how to get the package number to the if statement. I have tried

IF Eval("Package") =
That didnt work

Any ideas on this. Appreciate any help

 
Old March 12th, 2007, 08:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Where do you fetch the Package from? Is that from a form post or with Querystring or comes from the db? What is the problem you face?

_________________________
- Vijay G
Strive for Perfection
 
Old March 12th, 2007, 12:02 PM
Authorized User
 
Join Date: Mar 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ListingDBConnectionString %>"
            SelectCommand="SELECT [ID], [CompName], [Package], [Description] FROM [CompanyDetails] WHERE ([ID] = @ID)">
          <SelectParameters>
          <asp:QueryStringParameter Name="ID" QueryStringField="id" Type="Int32" />
          </SelectParameters>
</asp:SqlDataSource>

So this is the second page. We have the id from the querystring and now I need to do an IF THEN ELSE on the package. But I dont know how to call the db field package to the IF statement.

IF [Package] = etc then






Similar Threads
Thread Thread Starter Forum Replies Last Post
How Run .sql Script file in MS SQL Server 2000? aarkaycee SQL Server 2000 5 October 12th, 2009 05:43 AM
creating ssis packagte for sql server to sql serer Laxmikant_it ASP.NET 3.5 Professionals 0 November 26th, 2008 12:23 AM
Converting from MS SQL 2005 to Sql Epress edition saif44 SQL Language 0 February 16th, 2007 04:17 PM
Failed to copy objects from SQL server to SQL Serv monfu SQL Server 2000 4 December 4th, 2005 05:54 PM
Move SQL DB from one sql to another sql server Israr SQL Server 2000 3 January 24th, 2005 02:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.