|
-
Jul 18th, 2020, 09:17 AM
#41
Thread Starter
Member
Re: vb.net improve programs
ok i guess this is too much difficult for me..
stations it's correctly filled but combobox1 is empty.
i keep on matrix.
it takes longer,very hard to inquiry but it works
many thanks to all of you
-
Jul 18th, 2020, 09:20 AM
#42
Re: vb.net improve programs
you can create a Access .mdb and Access doesn't have to be Installed
on your Company PC
Code:
Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
'Add the COM Reference, "Microsoft ADO Ext. 6.0 for DLL and Security"
' create the empty DB file
Dim cat As New ADOX.Catalog()
cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Berichte\Backup.mdb")
cat = Nothing
End Sub
as easy as that
to hunt a species to extinction is not logical !
since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.
-
Jul 23rd, 2020, 07:39 AM
#43
Thread Starter
Member
Re: vb.net improve programs
 Originally Posted by jmcilhinney
It's not going to be a SQL query because you're not querying a database. Let's say that you have a DataTable with the names of stations in Partenza and Arrivo columns and you want to list distinct values in alphabetical order. One option is to use a LINQ query:
vb.net Code:
Dim partenzaStations = table.AsEnumerable().Select(Function(row) row.Field(Of String)("Partenza"))
Dim arrivoStations = table.AsEnumerable().Select(Function(row) row.Field(Of String)("Arrivo"))
Dim stations = partenzaStations.Concat(arrivoStations).Distinct().OrderBy(Function(s) s).ToArray()
stationComboBox.DataSource = stations
it works only if i don't order the list,otherwise the combobox it wont' be loaded !!
i guess it's due the first value is nothing.
but the where condition can not be applyied in the query.so strange
Last edited by eurostar_italia; Jul 23rd, 2020 at 10:19 AM.
-
Jul 23rd, 2020, 03:11 PM
#44
Thread Starter
Member
Re: vb.net improve programs
at the end i solved in this way :
Code:
Dim partenzaStations = From n In treno1.AsEnumerable()
Where n.Field(Of String)("Partenza") IsNot Nothing
Select n.Field(Of String)("Partenza")
Dim arrivoStations = From n In treno1.AsEnumerable()
Where n.Field(Of String)("Arrivo") IsNot Nothing
Select n.Field(Of String)("Arrivo")
Dim stations = partenzaStations.Concat(arrivoStations).Distinct().OrderBy(Function(s) s).ToArray()
ComboBox1.DataSource = stations.ToArray
ComboBox1.SelectedIndex = -1
maybe it will help somebody else
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|