Welcome to Foxite.COM Community Weblog Sign in | Join | Help

Combo Object in VFP and VB (VFP has flexible poperties, VB has stronger poperties)

VFP is stronger with database work, so if you need add a ítem in the combobox you can see this:

Add a combobox with :

RowSourceType=3

BondColumn=2

Note: the next code in vfp is very nice. (you need enter double equal)

Rowsource = = datos(1)

In the command window you put: set procedure to <your program>

<in your program put>

 

PROCEDURE datos

     LPARAMETERS tipo as Integer

     DO case

          CASE tipo=1 &&combo con seleccione item

                SELECT empresas.emp_nombre,emp_codigo FROM empresas into cursor combolista1 readwrite

                INSERT INTO combolista1 values ("Seleccione un item",0)

                SELECT * FROM combolista1 ORDER BY emp_codigo INTO CURSOR combolista1

 

     ENDCASE

ENDPROC

 

RETURN "combolista1"

WOW this is very nice, this code is optimized for VFP but his performance not is sufficient.

 

Now you can get a best performance in VB with the next code for the same functionality.

                Add a DropDownList with:

      DataSourceId = SqlDataSource1 (this has a connection asn ci,name fields)

      DataTextField=nombre

      DataValueField=ci

      AppendDataBoundItem=true

      In the eventhandle= Page_Load

        If Not Page.IsPostBack Then

            Dim lista As New ListItem

            lista.Text = "Seleccione un item"

            lista.Value = 0

            Me.DropDownList1.Items.Add(lista)

        End If

Wow this is very nice with the best performance.
Published Monday, December 10, 2007 8:38 PM by frankling
Filed Under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

What do you think?

(required) 
required 
(required)