Solved

Insert Items in ddlb of dw column

Posted on 2004-04-13
4
613 Views
Last Modified: 2013-12-26
Hi,

I have one column in my dw object with style as ddlb. I have not inserted any items in design time. I want to insert these items dynamically.
Please let me know the property to insert the items with display value and data value in that.

Thanks
Srinib
0
Comment
Question by:srinib
  • 2
4 Comments
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 10819072
See SetValue, GetValue Functions

Example:
dw_employee.SetValue("emp_state", 3, "Texas")
string Status

Status = dw_employee.GetValue(7,3)

Regards
0
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 10819074
See SetValue, GetValue Functions

Example:
dw_employee.SetValue("emp_state", 3, "Texas")
string Status

Status = dw_employee.GetValue(7,3)

Regards
0
 
LVL 18

Expert Comment

by:diasroshan
ID: 10820092
hi srinib,

u can set the values as follows....

dw_1.Object.status.Values = "Active~tA/Part Time~tP/Terminated~tT"


where,
Active,Part time and Terminated are the display values and...
A, P, T are the datavalues....and
status is the column on the dw which is ddlb....

u can use ur normal dot object notation in itemchanged or any event to get the value of column 'status'...


Cheers,
Rosh
0
 
LVL 8

Accepted Solution

by:
gajender_99 earned 50 total points
ID: 10821690
The following statements use a SQL cursor and FETCH statement to populate the ListBox portion of a DropDownListBox style column called product_col of a DataWindow object with code table values:

integer prod_code, i = 1

string prod_name

DECLARE prodcur CURSOR FOR
            SELECT product.name, product.code
            FROM product USING SQLCA;

CONNECT USING SQLCA;

IF SQLCA.SQLCode <> 0 THEN
            MessageBox("Status","Connect Failed " &
                  + SQLCA.SQLErrText)
            RETURN

END IF

OPEN prodcur;

IF SQLCA.SQLCode <> 0 THEN
            MessageBox("Status","Cursor Open Failed " &
                  + SQLCA.SQLErrText)
            RETURN

END IF

FETCH prodcur INTO :prod_name, :prod_code;

DO WHILE SQLCA.SQLCode = 0
            dw_products.SetValue("product_col", i, &
                  prod_name + "~t" + String(prod_code))
            i = i + 1
            FETCH prodcur INTO :prod_name, :prod_code;

LOOP

CLOSE prodcur;

DISCONNECT USING SQLCA;

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
eclipse ide not starting 16 79
How to debug CodeIgniter (PHP) 7 275
Java Help 2 79
eclipse package explorer vs project explorer view 2 79
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now