PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET VB 2005 Newbie - Binding?

Reply

VB 2005 Newbie - Binding?

 
Thread Tools Rate Thread
Old 05-07-2006, 04:09 PM   #1
Oh-its-all-gone-wrong
Guest
 
Posts: n/a
Default VB 2005 Newbie - Binding?


Hi All,



Hope everybody is well? I hope you all don`t mind a newbie asking a rather
daft question but here goes. Im using Visual Basic 2005, i`ll try and
explain best I can:



I have a form, on the form is various items. I have a Datagrid which is
bound to a table called ADSL. I also have some text box`s on all bound to
the coloums in the ADSL table. All works great and seem the sync is ok as
when I change the row on the data table the text box`s update to reflect the
move and vise versa. I also have some ComboBox`s which are linked to
separate tables, and the tables are linked by 1 to many relationships.



On my combobox for location I have in my databindings property for example:



SelectedItem: M_BTADSLBindingSource - LocationsID

SelectedValue: M_BTADSLBindingSource - BTAnalougeLinesID

Selected Text: MBTAnalogueLinesBindingSource - Number



Then in my forms load_event I have:



Me.S_LocationsTableAdapter.Fill(Me.MasterDBDataSet.S_Locations)

Me.M_BTADSLTableAdapter.Fill(Me.MasterDBDataSet.M_BTADSL)



However when I run my project I only get the first Location showing in the
combobox (This is the first one that is in the database table, dosn`t show
anymore). When I move position in the datagrid is donsn`t change the
Location in the ComboBox to reflect the one for that row in th database,
instead it just sits on the firstone in this case "Witham"



I hope I havn`t confused anyone and that maybe someone could point me in the
right direction?



I could post my project or e-mail it, if somebody would be so kind as to
help?



Many Thanks

SJG


  Reply With Quote
Old 05-07-2006, 04:21 PM   #2
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: VB 2005 Newbie - Binding?

SJG,

Why are you using a DataGrid and Visual Basic 2005. You say you are using a
combobox. I assume that is inside the DataGrid, which is with a DataGridView
a matter of setting properties.

Any reason that you don't use the DataGridView. This takes time to explain
and thinking about past methods.

Cor

"Oh-its-all-gone-wrong" <test@test.com> schreef in bericht
news:eCupyREoGHA.2068@TK2MSFTNGP02.phx.gbl...
> Hi All,
>
>
>
> Hope everybody is well? I hope you all don`t mind a newbie asking a rather
> daft question but here goes. Im using Visual Basic 2005, i`ll try and
> explain best I can:
>
>
>
> I have a form, on the form is various items. I have a Datagrid which is
> bound to a table called ADSL. I also have some text box`s on all bound to
> the coloums in the ADSL table. All works great and seem the sync is ok as
> when I change the row on the data table the text box`s update to reflect
> the move and vise versa. I also have some ComboBox`s which are linked to
> separate tables, and the tables are linked by 1 to many relationships.
>
>
>
> On my combobox for location I have in my databindings property for
> example:
>
>
>
> SelectedItem: M_BTADSLBindingSource - LocationsID
>
> SelectedValue: M_BTADSLBindingSource - BTAnalougeLinesID
>
> Selected Text: MBTAnalogueLinesBindingSource - Number
>
>
>
> Then in my forms load_event I have:
>
>
>
> Me.S_LocationsTableAdapter.Fill(Me.MasterDBDataSet.S_Locations)
>
> Me.M_BTADSLTableAdapter.Fill(Me.MasterDBDataSet.M_BTADSL)
>
>
>
> However when I run my project I only get the first Location showing in the
> combobox (This is the first one that is in the database table, dosn`t show
> anymore). When I move position in the datagrid is donsn`t change the
> Location in the ComboBox to reflect the one for that row in th database,
> instead it just sits on the firstone in this case "Witham"
>
>
>
> I hope I havn`t confused anyone and that maybe someone could point me in
> the right direction?
>
>
>
> I could post my project or e-mail it, if somebody would be so kind as to
> help?
>
>
>
> Many Thanks
>
> SJG
>
>



  Reply With Quote
Old 05-07-2006, 04:31 PM   #3
Oh-its-all-gone-wrong
Guest
 
Posts: n/a
Default Re: VB 2005 Newbie - Binding?

Hi Cor,

No, sorry i think i havn`t explained well enought. I have a Datagrid on my
Form, and the Combo Box`s are outside the Datagrid. They are seperatly on my
form.

Cheers
SJG

"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:ehODJaEoGHA.4352@TK2MSFTNGP02.phx.gbl...
> SJG,
>
> Why are you using a DataGrid and Visual Basic 2005. You say you are using
> a combobox. I assume that is inside the DataGrid, which is with a
> DataGridView a matter of setting properties.
>
> Any reason that you don't use the DataGridView. This takes time to explain
> and thinking about past methods.
>
> Cor
>
> "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht
> news:eCupyREoGHA.2068@TK2MSFTNGP02.phx.gbl...
>> Hi All,
>>
>>
>>
>> Hope everybody is well? I hope you all don`t mind a newbie asking a
>> rather daft question but here goes. Im using Visual Basic 2005, i`ll try
>> and explain best I can:
>>
>>
>>
>> I have a form, on the form is various items. I have a Datagrid which is
>> bound to a table called ADSL. I also have some text box`s on all bound to
>> the coloums in the ADSL table. All works great and seem the sync is ok as
>> when I change the row on the data table the text box`s update to reflect
>> the move and vise versa. I also have some ComboBox`s which are linked to
>> separate tables, and the tables are linked by 1 to many relationships.
>>
>>
>>
>> On my combobox for location I have in my databindings property for
>> example:
>>
>>
>>
>> SelectedItem: M_BTADSLBindingSource - LocationsID
>>
>> SelectedValue: M_BTADSLBindingSource - BTAnalougeLinesID
>>
>> Selected Text: MBTAnalogueLinesBindingSource - Number
>>
>>
>>
>> Then in my forms load_event I have:
>>
>>
>>
>> Me.S_LocationsTableAdapter.Fill(Me.MasterDBDataSet.S_Locations)
>>
>> Me.M_BTADSLTableAdapter.Fill(Me.MasterDBDataSet.M_BTADSL)
>>
>>
>>
>> However when I run my project I only get the first Location showing in
>> the combobox (This is the first one that is in the database table, dosn`t
>> show anymore). When I move position in the datagrid is donsn`t change the
>> Location in the ComboBox to reflect the one for that row in th database,
>> instead it just sits on the firstone in this case "Witham"
>>
>>
>>
>> I hope I havn`t confused anyone and that maybe someone could point me in
>> the right direction?
>>
>>
>>
>> I could post my project or e-mail it, if somebody would be so kind as to
>> help?
>>
>>
>>
>> Many Thanks
>>
>> SJG
>>
>>

>
>



  Reply With Quote
Old 05-07-2006, 05:13 PM   #4
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: VB 2005 Newbie - Binding?

SJG,

Can you show the binding to your combobox in true code, as you show it now
it is absolute no binding.

Cor

"Oh-its-all-gone-wrong" <test@test.com> schreef in bericht
news:%236cq3dEoGHA.4232@TK2MSFTNGP02.phx.gbl...
> Hi Cor,
>
> No, sorry i think i havn`t explained well enought. I have a Datagrid on my
> Form, and the Combo Box`s are outside the Datagrid. They are seperatly on
> my form.
>
> Cheers
> SJG
>
> "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
> news:ehODJaEoGHA.4352@TK2MSFTNGP02.phx.gbl...
>> SJG,
>>
>> Why are you using a DataGrid and Visual Basic 2005. You say you are using
>> a combobox. I assume that is inside the DataGrid, which is with a
>> DataGridView a matter of setting properties.
>>
>> Any reason that you don't use the DataGridView. This takes time to
>> explain and thinking about past methods.
>>
>> Cor
>>
>> "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht
>> news:eCupyREoGHA.2068@TK2MSFTNGP02.phx.gbl...
>>> Hi All,
>>>
>>>
>>>
>>> Hope everybody is well? I hope you all don`t mind a newbie asking a
>>> rather daft question but here goes. Im using Visual Basic 2005, i`ll try
>>> and explain best I can:
>>>
>>>
>>>
>>> I have a form, on the form is various items. I have a Datagrid which is
>>> bound to a table called ADSL. I also have some text box`s on all bound
>>> to the coloums in the ADSL table. All works great and seem the sync is
>>> ok as when I change the row on the data table the text box`s update to
>>> reflect the move and vise versa. I also have some ComboBox`s which are
>>> linked to separate tables, and the tables are linked by 1 to many
>>> relationships.
>>>
>>>
>>>
>>> On my combobox for location I have in my databindings property for
>>> example:
>>>
>>>
>>>
>>> SelectedItem: M_BTADSLBindingSource - LocationsID
>>>
>>> SelectedValue: M_BTADSLBindingSource - BTAnalougeLinesID
>>>
>>> Selected Text: MBTAnalogueLinesBindingSource - Number
>>>
>>>
>>>
>>> Then in my forms load_event I have:
>>>
>>>
>>>
>>> Me.S_LocationsTableAdapter.Fill(Me.MasterDBDataSet.S_Locations)
>>>
>>> Me.M_BTADSLTableAdapter.Fill(Me.MasterDBDataSet.M_BTADSL)
>>>
>>>
>>>
>>> However when I run my project I only get the first Location showing in
>>> the combobox (This is the first one that is in the database table,
>>> dosn`t show anymore). When I move position in the datagrid is donsn`t
>>> change the Location in the ComboBox to reflect the one for that row in
>>> th database, instead it just sits on the firstone in this case "Witham"
>>>
>>>
>>>
>>> I hope I havn`t confused anyone and that maybe someone could point me in
>>> the right direction?
>>>
>>>
>>>
>>> I could post my project or e-mail it, if somebody would be so kind as to
>>> help?
>>>
>>>
>>>
>>> Many Thanks
>>>
>>> SJG
>>>
>>>

>>
>>

>
>



  Reply With Quote
Old 06-07-2006, 08:41 AM   #5
Oh-its-all-gone-wrong
Guest
 
Posts: n/a
Default Re: VB 2005 Newbie - Binding?

Hi Cor,

How do I do that?


"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:uNdpZ3EoGHA.4848@TK2MSFTNGP03.phx.gbl...
> SJG,
>
> Can you show the binding to your combobox in true code, as you show it now
> it is absolute no binding.
>
> Cor
>
> "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht
> news:%236cq3dEoGHA.4232@TK2MSFTNGP02.phx.gbl...
>> Hi Cor,
>>
>> No, sorry i think i havn`t explained well enought. I have a Datagrid on
>> my Form, and the Combo Box`s are outside the Datagrid. They are seperatly
>> on my form.
>>
>> Cheers
>> SJG
>>
>> "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
>> news:ehODJaEoGHA.4352@TK2MSFTNGP02.phx.gbl...
>>> SJG,
>>>
>>> Why are you using a DataGrid and Visual Basic 2005. You say you are
>>> using a combobox. I assume that is inside the DataGrid, which is with a
>>> DataGridView a matter of setting properties.
>>>
>>> Any reason that you don't use the DataGridView. This takes time to
>>> explain and thinking about past methods.
>>>
>>> Cor
>>>
>>> "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht
>>> news:eCupyREoGHA.2068@TK2MSFTNGP02.phx.gbl...
>>>> Hi All,
>>>>
>>>>
>>>>
>>>> Hope everybody is well? I hope you all don`t mind a newbie asking a
>>>> rather daft question but here goes. Im using Visual Basic 2005, i`ll
>>>> try and explain best I can:
>>>>
>>>>
>>>>
>>>> I have a form, on the form is various items. I have a Datagrid which is
>>>> bound to a table called ADSL. I also have some text box`s on all bound
>>>> to the coloums in the ADSL table. All works great and seem the sync is
>>>> ok as when I change the row on the data table the text box`s update to
>>>> reflect the move and vise versa. I also have some ComboBox`s which are
>>>> linked to separate tables, and the tables are linked by 1 to many
>>>> relationships.
>>>>
>>>>
>>>>
>>>> On my combobox for location I have in my databindings property for
>>>> example:
>>>>
>>>>
>>>>
>>>> SelectedItem: M_BTADSLBindingSource - LocationsID
>>>>
>>>> SelectedValue: M_BTADSLBindingSource - BTAnalougeLinesID
>>>>
>>>> Selected Text: MBTAnalogueLinesBindingSource - Number
>>>>
>>>>
>>>>
>>>> Then in my forms load_event I have:
>>>>
>>>>
>>>>
>>>> Me.S_LocationsTableAdapter.Fill(Me.MasterDBDataSet.S_Locations)
>>>>
>>>> Me.M_BTADSLTableAdapter.Fill(Me.MasterDBDataSet.M_BTADSL)
>>>>
>>>>
>>>>
>>>> However when I run my project I only get the first Location showing in
>>>> the combobox (This is the first one that is in the database table,
>>>> dosn`t show anymore). When I move position in the datagrid is donsn`t
>>>> change the Location in the ComboBox to reflect the one for that row in
>>>> th database, instead it just sits on the firstone in this case "Witham"
>>>>
>>>>
>>>>
>>>> I hope I havn`t confused anyone and that maybe someone could point me
>>>> in the right direction?
>>>>
>>>>
>>>>
>>>> I could post my project or e-mail it, if somebody would be so kind as
>>>> to help?
>>>>
>>>>
>>>>
>>>> Many Thanks
>>>>
>>>> SJG
>>>>
>>>>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Old 06-07-2006, 09:07 AM   #6
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: VB 2005 Newbie - Binding?

SJG,

I thought that I asked to show you your code you have made now to do the
binding?

Cor

"Oh-its-all-gone-wrong" <test@test.com> schreef in bericht
news:ezjW87MoGHA.764@TK2MSFTNGP03.phx.gbl...
> Hi Cor,
>
> How do I do that?
>
>
> "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
> news:uNdpZ3EoGHA.4848@TK2MSFTNGP03.phx.gbl...
>> SJG,
>>
>> Can you show the binding to your combobox in true code, as you show it
>> now it is absolute no binding.
>>
>> Cor
>>
>> "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht
>> news:%236cq3dEoGHA.4232@TK2MSFTNGP02.phx.gbl...
>>> Hi Cor,
>>>
>>> No, sorry i think i havn`t explained well enought. I have a Datagrid on
>>> my Form, and the Combo Box`s are outside the Datagrid. They are
>>> seperatly on my form.
>>>
>>> Cheers
>>> SJG
>>>
>>> "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
>>> news:ehODJaEoGHA.4352@TK2MSFTNGP02.phx.gbl...
>>>> SJG,
>>>>
>>>> Why are you using a DataGrid and Visual Basic 2005. You say you are
>>>> using a combobox. I assume that is inside the DataGrid, which is with a
>>>> DataGridView a matter of setting properties.
>>>>
>>>> Any reason that you don't use the DataGridView. This takes time to
>>>> explain and thinking about past methods.
>>>>
>>>> Cor
>>>>
>>>> "Oh-its-all-gone-wrong" <test@test.com> schreef in bericht
>>>> news:eCupyREoGHA.2068@TK2MSFTNGP02.phx.gbl...
>>>>> Hi All,
>>>>>
>>>>>
>>>>>
>>>>> Hope everybody is well? I hope you all don`t mind a newbie asking a
>>>>> rather daft question but here goes. Im using Visual Basic 2005, i`ll
>>>>> try and explain best I can:
>>>>>
>>>>>
>>>>>
>>>>> I have a form, on the form is various items. I have a Datagrid which
>>>>> is bound to a table called ADSL. I also have some text box`s on all
>>>>> bound to the coloums in the ADSL table. All works great and seem the
>>>>> sync is ok as when I change the row on the data table the text box`s
>>>>> update to reflect the move and vise versa. I also have some ComboBox`s
>>>>> which are linked to separate tables, and the tables are linked by 1 to
>>>>> many relationships.
>>>>>
>>>>>
>>>>>
>>>>> On my combobox for location I have in my databindings property for
>>>>> example:
>>>>>
>>>>>
>>>>>
>>>>> SelectedItem: M_BTADSLBindingSource - LocationsID
>>>>>
>>>>> SelectedValue: M_BTADSLBindingSource - BTAnalougeLinesID
>>>>>
>>>>> Selected Text: MBTAnalogueLinesBindingSource - Number
>>>>>
>>>>>
>>>>>
>>>>> Then in my forms load_event I have:
>>>>>
>>>>>
>>>>>
>>>>> Me.S_LocationsTableAdapter.Fill(Me.MasterDBDataSet.S_Locations)
>>>>>
>>>>> Me.M_BTADSLTableAdapter.Fill(Me.MasterDBDataSet.M_BTADSL)
>>>>>
>>>>>
>>>>>
>>>>> However when I run my project I only get the first Location showing in
>>>>> the combobox (This is the first one that is in the database table,
>>>>> dosn`t show anymore). When I move position in the datagrid is donsn`t
>>>>> change the Location in the ComboBox to reflect the one for that row in
>>>>> th database, instead it just sits on the firstone in this case
>>>>> "Witham"
>>>>>
>>>>>
>>>>>
>>>>> I hope I havn`t confused anyone and that maybe someone could point me
>>>>> in the right direction?
>>>>>
>>>>>
>>>>>
>>>>> I could post my project or e-mail it, if somebody would be so kind as
>>>>> to help?
>>>>>
>>>>>
>>>>>
>>>>> Many Thanks
>>>>>
>>>>> SJG
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off