CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 ListBox with INT and VARCHAR

Print topic Send  topic

Author Message
janiali

Posts: 44
Posted: 12/06/2007, 3:03 AM

hi
I am new in ASP i need some's help .
I have a table called
"activity" and columns for this table are
actID
actTpyeID
ActName

I want "ActID" and "ActName" should appear in th elist box togather is it possible as ActID is INT and Act Name is VARCHAR . I tried all the fourms help but could not able to solve this problem every where they are useing first name and last name but I have some diffrent type of inforamtion .
Please help
thanks in Advance
Jani

_________________
Jani Ali
View profile  Send private message
kevind

Posts: 251
Posted: 12/06/2007, 7:19 AM

you can do 2 things:

1. create a view/query in your Database that puts the two columns together as 1 and use this for the datasource (don't forget the bound column too)

2. change the datasource for the listbox to SQL statement and use something like:

SELECT actTypeID, cstr( actID)+ " - " + ActName as actIDAndName FROM MyTableNameHere

hope that helps
_________________
thanks
Kevin

======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
View profile  Send private message
janiali

Posts: 44
Posted: 12/06/2007, 7:33 AM

Quote kevind:
you can do 2 things:

1. create a view/query in your Database that puts the two columns together as 1 and use this for the datasource (don't forget the bound column too)

2. change the datasource for the listbox to SQL statement and use something like:

SELECT actTypeID, cstr( actID)+ " - " + ActName as actIDAndName FROM MyTableNameHere

hope that helps

when I put your second line it give me this error
'cstr' is not a recognized function name. (Microsoft OLE DB Provider for SQL Server)

and why you are useing ActType ?
I don't want to use ActType I just want ActID and Act Name in the listbox
Please write the complete thing for me as I am new in programming .
other wise tell me how I can see activity numbers with the Activity NAme in the listbox
thanks
Jani

_________________
Jani Ali
View profile  Send private message
ReneS

Posts: 225
Posted: 12/06/2007, 10:28 AM

Hi,

use google, search for concat or concatenate, then use whatever your database pleases.

Rene
View profile  Send private message
Edd


Posts: 547
Posted: 12/06/2007, 12:41 PM

SELECT actTypeID, cstr( actID)+ " - " + ActName as actIDAndName FROM MyTableNameHere
Sould be
SELECT actTypeID, Cast( actID as varchar(7))+ ' - '+ ActName as actIDAndName FROM MyTableNameHere

SQL is not the same from database to database my SQL is for Microsoft SQL.

Cheers - Edd
_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message
janiali

Posts: 44
Posted: 12/06/2007, 10:51 PM

Quote Edd:
SELECT actTypeID, cstr( actID)+ " - " + ActName as actIDAndName FROM MyTableNameHere
Sould be
SELECT actTypeID, Cast( actID as varchar(7))+ ' - '+ ActName as actIDAndName FROM MyTableNameHere

SQL is not the same from database to database my SQL is for Microsoft SQL.

Cheers - Edd

THANKS A LOT EDD

I have done it with you r great help
really great full

_________________
Jani Ali
View profile  Send private message
janiali

Posts: 44
Posted: 12/06/2007, 11:10 PM

Quote janiali:
Quote Edd:
SELECT actTypeID, cstr( actID)+ " - " + ActName as actIDAndName FROM MyTableNameHere
Sould be
SELECT actTypeID, Cast( actID as varchar(7))+ ' - '+ ActName as actIDAndName FROM MyTableNameHere

SQL is not the same from database to database my SQL is for Microsoft SQL.

Cheers - Edd

THANKS A LOT EDD
I have solved that
But Now I have another problem related to this Listbox because this list box is dependent list of the above one listbox
so now when ever I am chaging above list box the down one is not getting the value related to that listbox it showing me all the value . so please help
before I was using the Parameter in table/view ProgramID=programID (URL) so can you please tell me that I can use that Parameter here or not ?
if I canuse that what will be that parameter ?



_________________
Jani Ali
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.