Problems with ListBox and query's

serch87

Member
Hi, everyone I don't now how to resolve this situation I'm do to a small aplication for my phone whit WM6.
I do to a simple query and try to pass the result to a ListBox control but I get the following error:

Object of type 'Dbasic.EnchancedControls.CEnhancedListBox'cannot be converted to type 'System.Windows.Forms.DataGrid'.

I'm following teh steps of tutorial of SQLite libraries.
I hope someone can help me with this, and sorry for my bad English.


Gracias y espero que alguien que si hable español me pueda ayudar.

:sign0085:
 

mjcoon

Well-Known Member
Licensed User
I am not sure that I would be able to assist but I suggest that you attach your complete code to your question so that someone else can try it out.

Or at least quote the content of the line at which the error message occurs...

Mike.
 

serch87

Member
Hi Mike, Tanks for answering so fast, I have the follow code:
133 Sub PasarLista(stat)
134 ' Start transaction
135 Connection.BeginTransaction
136
137 Command.CommandText = "SELECT * FROM clientes"
138 Command.ExecuteTable("Lista1", 100)
139
140 ' End transaction
141 Connection.EndTransaction
142 End Sub

when I run the program show me this error message:

An error ocurred on sub main.pasalista.

Line number:138

Command.ExecuteTable("Lista1", 1000)
Error description:
Object of type 'Dbasic.EnhancedControls.CEnhancedListBox' cannot be
converted to type 'System.Windows.Forms.DataGrid'.

I don't know what's happens, if I write the code exactly from the tutorial of SQLite library.
One more time I'm sorry for my bad English and I hope someone help me.
 

timsteeman

Member
Licensed User
Longtime User
What kind of control is lista1

Command.ExecuteTable("Lista1", 1000)
The executetable command "exports" the dataset to a tablecontrol. So, is your "Lista1" a tablecontrol?
Tim
 

serch87

Member
Hi Tim, after reviewing my program I realized that the control "Lista1" was not a Table Control.
In the tutorial does not mention that little detail, thanks for all your help and patience for me.



Sergio.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…