Click here to Skip to main content
15,916,835 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Produce reports. Any help plz? Pin
Tom Deketelaere4-Jan-08 5:25
professionalTom Deketelaere4-Jan-08 5:25 
GeneralRe: Produce reports. Any help plz? Pin
tellytub4-Jan-08 23:13
tellytub4-Jan-08 23:13 
GeneralRe: Produce reports. Any help plz? Pin
Tom Deketelaere7-Jan-08 1:04
professionalTom Deketelaere7-Jan-08 1:04 
QuestionDisplay String With Quotes Pin
Dan Suthar3-Jan-08 15:05
professionalDan Suthar3-Jan-08 15:05 
GeneralRe: Display String With Quotes Pin
Christian Graus3-Jan-08 15:15
protectorChristian Graus3-Jan-08 15:15 
AnswerRe: Display String With Quotes Pin
Nilesh Hapse3-Jan-08 18:32
Nilesh Hapse3-Jan-08 18:32 
AnswerRe: Display String With Quotes Pin
Dan Suthar3-Jan-08 23:36
professionalDan Suthar3-Jan-08 23:36 
GeneralFill By Methods Vs. Binding Source Pin
AAGTHosting3-Jan-08 12:43
AAGTHosting3-Jan-08 12:43 
I have a question. I need to know if it would be better for me to use a fill by method or a binding source.

Here is what I am doing.

I have a check box and 2 combo boxes for each day of the week. The user would check the Monday check box and then choose a time of day such as 6:00PM in the from time and 10:00PM in the to time combo box. Once the user selects the times the combo boxes populate these times from a database table and sets the selected value from another table that holds the time they selected.

Can you tell me what would be better to do? Should I use a FillBy Method or a Binding Source? When I first learned VB.Net in college about 2 years ago I just wrote a query and used a data adapter. I am new to VB.NET 2005 and have very little experience in VB.

When I added the () to (BindingSource) Dim instance As BindingSource() the instances are getting a blue squigly line. Why?

Here is the code I am writing using a Binding Source.

Dim bsMonStoreSched As BindingSource()<br />
        Dim bsTuesStoreSched As BindingSource()<br />
        Dim bsWedStoreSched As BindingSource()<br />
        Dim bsThurStoreSched As BindingSource()<br />
        Dim bsFriStoreSched As BindingSource()<br />
        Dim bsSatStoreSched As BindingSource()<br />
        Dim bsSunStoreSched As BindingSource()<br />
<br />
        ' create table adapter objects<br />
        Dim hoursTableAdapter As New theLessonProgramDataSetTableAdapters.tbl_hoursTableAdapter<br />
        Dim schedTableAdapter As New theLessonProgramDataSetTableAdapters.tbl_store_schedTableAdapter<br />
<br />
        ' create data set objects<br />
        Dim lpDataSet As New theLessonProgramDataSet()<br />
<br />
        ' create dataTables<br />
        Dim dtHours, dtSched As New DataTable()<br />
<br />
        ' create binding source<br />
        Dim bsHours As BindingSource<br />
        Dim bsStoreSched As BindingSource<br />
<br />
        ' fill the dataTables<br />
        Try<br />
            hoursTableAdapter.Fill(lpDataSet.tbl_hours)<br />
            schedTableAdapter.Fill(lpDataSet.tbl_store_sched)<br />
        Catch err As Exception<br />
            MessageBox.Show(err.Message)<br />
        End Try<br />
<br />
        dtHours = lpDataSet.tbl_hours<br />
        dtSched = lpDataSet.tbl_store_sched<br />
<br />
        ' Set the binding Source for mon - sun<br />
        bsMonStoreSched.DataSource = dtSched<br />
        bsTuesStoreSched.DataSource = dtSched<br />
        bsWedStoreSched.DataSource = dtSched<br />
        bsThurStoreSched.DataSource = dtSched<br />
        bsFriStoreSched.DataSource = dtSched<br />
        bsSatStoreSched.DataSource = dtSched<br />
        bsSunStoreSched.DataSource = dtSched<br />
<br />
        ' Filter the items to show results.<br />
        bsMonStoreSched.Filter = "ss_day = 'Monday'"<br />
        bsTuesStoreSched.Filter = "ss_day = 'Tuesday'"<br />
        bsWedStoreSched.Filter = "ss_day = 'Wednesday'"<br />
        bsThurStoreSched.Filter = "ss_day = 'Thursday'"<br />
        bsFriStoreSched.Filter = "ss_day = 'Friday'"<br />
        bsSatStoreSched.Filter = "ss_day = 'Saturday'"<br />
        bsSunStoreSched.Filter = "ss_day = 'Sunday'"<br />
<br />
        ' fill the Mon - Sun combo boxes with the hours<br />
        cboLSMonFrom.DataSource = dtHours<br />
        cboLSMonFrom.DisplayMember = "h_time"<br />
        cboLSMonFrom.ValueMember = "h_id"<br />
        cboLSTuesFrom.DataSource = dtHours<br />
        cboLSTuesFrom.DisplayMember = "h_time"<br />
        cboLSTuesFrom.ValueMember = "h_id"<br />
        cboLSWedFrom.DataSource = dtHours<br />
        cboLSWedFrom.DisplayMember = "h_time"<br />
        cboLSWedFrom.ValueMember = "h_id"<br />
        cboLSThurFrom.DataSource = dtHours<br />
        cboLSThurFrom.DisplayMember = "h_time"<br />
        cboLSThurFrom.ValueMember = "h_id"<br />
        cboLSFriFrom.DataSource = dtHours<br />
        cboLSFriFrom.DisplayMember = "h_time"<br />
        cboLSFriFrom.ValueMember = "h_id"<br />
        cboLSSatFrom.DataSource = dtHours<br />
        cboLSSatFrom.DisplayMember = "h_time"<br />
        cboLSSatFrom.ValueMember = "h_id"<br />
        cboLSSunFrom.DataSource = dtHours<br />
        cboLSSunFrom.DisplayMember = "h_time"<br />
        cboLSSunFrom.ValueMember = "h_id"<br />
<br />
        ' bind the list controls selected value property<br />
        cboLSMonFrom.DataBindings.Add("SelectedValue", bsMonStoreSched, "ss_id")<br />
        cboLSTuesFrom.DataBindings.Add("SelectedValue", bsTuesStoreSched, "ss_id")<br />
        cboLSWedFrom.DataBindings.Add("SelectedValue", bsWedStoreSched, "ss_id")<br />
        cboLSThurFrom.DataBindings.Add("SelectedValue", bsThurStoreSched, "ss_id")<br />
        cboLSFriFrom.DataBindings.Add("SelectedValue", bsFriStoreSched, "ss_id")<br />
        cboLSSatFrom.DataBindings.Add("SelectedValue", bsSatStoreSched, "ss_id")<br />
        cboLSSunFrom.DataBindings.Add("SelectedValue", bsSunStoreSched, "ss_id")

GeneralRe: Fill By Methods Vs. Binding Source Pin
Dave Kreskowiak3-Jan-08 14:24
mveDave Kreskowiak3-Jan-08 14:24 
Generala coding problem Pin
s3rro3-Jan-08 10:42
s3rro3-Jan-08 10:42 
GeneralRe: a coding problem Pin
Dave Kreskowiak3-Jan-08 10:58
mveDave Kreskowiak3-Jan-08 10:58 
GeneralRe: a coding problem Pin
Ray Cassick3-Jan-08 11:30
Ray Cassick3-Jan-08 11:30 
QuestionApplication exits without error message Pin
Volker Weichert3-Jan-08 9:06
Volker Weichert3-Jan-08 9:06 
GeneralRe: Application exits without error message Pin
Christian Graus3-Jan-08 11:12
protectorChristian Graus3-Jan-08 11:12 
GeneralRe: Application exits without error message Pin
Volker Weichert4-Jan-08 1:55
Volker Weichert4-Jan-08 1:55 
GeneralCannot cast from ControlCollection to ControlCollection Pin
Ed Hill _5_3-Jan-08 6:30
Ed Hill _5_3-Jan-08 6:30 
GeneralRe: Cannot cast from ControlCollection to ControlCollection Pin
Ed Hill _5_3-Jan-08 6:34
Ed Hill _5_3-Jan-08 6:34 
GeneralRe: Cannot cast from ControlCollection to ControlCollection Pin
Dave Kreskowiak3-Jan-08 7:16
mveDave Kreskowiak3-Jan-08 7:16 
GeneralRe: Cannot cast from ControlCollection to ControlCollection Pin
Ed Hill _5_3-Jan-08 22:25
Ed Hill _5_3-Jan-08 22:25 
GeneralInvoice Management System Pin
wEb GuRu...3-Jan-08 1:26
wEb GuRu...3-Jan-08 1:26 
GeneralRe: Invoice Management System Pin
Dave Kreskowiak3-Jan-08 5:03
mveDave Kreskowiak3-Jan-08 5:03 
GeneralRe: Invoice Management System Pin
wEb GuRu...3-Jan-08 5:09
wEb GuRu...3-Jan-08 5:09 
GeneralInserting XML Elements using XMlDocument Pin
Benny_Lava3-Jan-08 0:18
Benny_Lava3-Jan-08 0:18 
GeneralRe: Inserting XML Elements using XMlDocument Pin
Dave Kreskowiak3-Jan-08 4:59
mveDave Kreskowiak3-Jan-08 4:59 
GeneralRe: Inserting XML Elements using XMlDocument Pin
Kschuler3-Jan-08 5:48
Kschuler3-Jan-08 5:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.