Solved

Insert Items in ddlb of dw column

Posted on 2004-04-13
4
611 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

762 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

6 Experts available now in Live!

Get 1:1 Help Now