On Visual Basic .net, I can do this:
The DataTable object has many properties such as:
* Read data from a text file, XML, etc..
* It can index at runtime any field
* You can filter
* You can attach the object to almost anything
Example:
These three lines, fill a combo with an ID, to know what was selected and a text, which is what the user sees.
This is a real need because for example:
The SQL library returns a value of type Cursor
The MySQL library returns a value type List
Now I need to combine these values and later an XML or text file. To do this, I'll have to "invent" intermediate functions cycles For / Next. The Cursor see Columns, but for List, the first row is the column.
Some believe that the possibility of doing something about this programming language?.
Sorry if not well understood my English, I am using Google Translate Spanish> English
Lamento mucho si no se entiende bien mi inglés, estoy utilizando el traductor de Google Español > Inglés
B4X:
Dim dtTemp as New DataTable
Dim col1 As DataColumn
Dim col2 As DataColumn
col1 = New DataColumn
col2 = New DataColumn
col1.DataType = System.Type.GetType("System.String")
col1.ColumnName = "dtTemp_id"
col2.DataType = System.Type.GetType("System.String")
col2.ColumnName = "dtTemp_desc"
dtTemp.Columns.Add(col1)
dtTemp.Columns.Add(col2)
For Each drList As DataRow In drFilter
dtTemp.Rows.Add(drList(0), IIf(drList(2).ToString = String.Empty, drList(1), drList(2) & " - " & drList(1)))
Next
The DataTable object has many properties such as:
* Read data from a text file, XML, etc..
* It can index at runtime any field
* You can filter
* You can attach the object to almost anything
Example:
B4X:
Me.cmbMerca.DataSource = dtTemp
Me.cmbMerca.DisplayMember = "dtTemp_desc"
Me.cmbMerca.ValueMember = "dtTemp_id"
These three lines, fill a combo with an ID, to know what was selected and a text, which is what the user sees.
This is a real need because for example:
The SQL library returns a value of type Cursor
The MySQL library returns a value type List
Now I need to combine these values and later an XML or text file. To do this, I'll have to "invent" intermediate functions cycles For / Next. The Cursor see Columns, but for List, the first row is the column.
Some believe that the possibility of doing something about this programming language?.
Sorry if not well understood my English, I am using Google Translate Spanish> English
Lamento mucho si no se entiende bien mi inglés, estoy utilizando el traductor de Google Español > Inglés