Pretty basic question I hope ... I am trying to create a Windows Form that will allow the user to choose a League from a ComboBox and then send E:Mails depending on what he chooses in a second ComboBox.
It is not for use over a network, just on one person's PC so I don't have to worry about massive security issues.
I have designed the Form and I have a very basic SQL database as part of the Project, the form has a BindingSource, a BindingNavigator and a TableAdapter all included.
The question is, how do I populate the first ComboBox with the data that is in the Leagues DataSet ? Can I do this, is this data freely available or do I still have to go down the path of creating a ConnectionString and all the DataTable, DataSet, DataAdapter variables etc., etc. ?
VS2010 automatically gives me the following code ...
Private Sub KAmail_Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.LeaguesTableAdapter.Fill(Me.DB_KAmailDataSet.Leagues)
End Sub
... can I do something similar to "Fill" the ComboBox with the League Names ? The following code adds 1 line per League to the ComboBox, but it's not the Value of the entry, it is a text line that says "KAmail.DB_KAmailDataSet+LeaguesRow" ...
For MyIx = 0 To DB_KAmailDataSet.Leagues.Count - 1
KAmail_ComboBox1.Items.Add(Me.DB_KAmailDataSet.Leagues.Item(MyIx))
Next
This is the CodeProject article that I used to base my work on ...
Quickest Way to Create a .NET Database Application[
^]