473,856 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combobox lookup binding with bound controls - Please help!

Hi-
I've seen this problem discussed a jillion times but I cannot seem to
implement any advice that makes it work. I am porting a large project from
VB6 to .NET. The issue is using the combo box bound to a table as a lookup,
drawing values from another table to populate the available selections. This
all worked fine in VB6.

I have distilled the problem down to a simple form drawing data from the
Northwind database for a representative model so that it can easily be
duplicated by anyone.
1. I use two tables, Orders and Customers. Orders contains a FK from
Customers called CustomerID.
2. Create one form, with text fields bound to columns from the Orders table,
except for Orders.Customer ID. Orders.Customer ID is bound and displayed in the
Combobox. Navigation buttons are used to move around in the orders table,
with buttons to add rows, etc. You can use a wizard to generate this very
easily.
3. The idea is one can add a new order to the Orders table, and make a
selection for the customerID by using a value from the combobox, or change an
existing CustomerID to a different one. The CustomerID values in the
combobox are all populated from the Customers table. Of course, as one
scrolls through orders using the navigation buttons the value displayed in
the combobox changes accordingly, as do the rest of the columns displayed in
the text fields.
4. I have used various means of doing this with various results, all bad.

a. Using one dataadapter and one dataset. Orders table and Customers table
are added to the dataset. All form datafields, including the combobox are
bound to the Orders table with statements similar to the following:
Me.editShipName .DataBindings.A dd(New System.Windows. Forms.Binding(" Text",
Me.dsOrders, "Orders.ShipNam e"))

The Orders table is loaded into the form controls with
SqldataAdapter1 .fill(ds, "Orders"). The Combobox lookup values are the
loaded by Sqldataadapter1 .Fill(ds,"Custo mers") with displaymember set to
CustomerID. This throws an exception regarding nonnull, key restraints
violated. etc. I have tried adding a relation between the tables on
customerID to no avail.

b. I created another dataadapter for just the customer table in order to
load the lookup values. Orders is bound to the controls as before with the
Combobox being loaded by another dataset from datadapter2.fil l:
SqlDataAdapter2 .Fill(custTemp, "Customers" )
ComboBox1.DataS ource = custTemp.Tables (0)
ComboBox1.Displ ayMember = "CustomerID "

This second method works fine- the combo is populated and changes values as
one scrolls through the orders table with with navigation buttons. However,
you cannot change the value in the combobox or add a new row because the
value selected in the combobox just changes back to the orginal value if one
moves to the next record or reloads the dataset. Obviously the change is not
being saved.

c. Same as b, but after the combobox is filled with the CustomerID lookup
values from the Customers table, I rebind the combo to the orginal Order
table with:
ComboBox1.DataB indings.Add("te xt", dsOrders.Tables (0), "CustomerID ") or
ComboBox1.DataB indings.Add("te xt", jdsOrders, "Orders.Custome rID")
Neither have any effect.

I believe I have a currency manager issue. I am doing everything right
except for the combobox. I can even add rows if the combobox is not populated
with the lookup values. I even tried adding:
ComboBox1.Bindi ngContext = New BindingContext
before populating the combobox with the lookup values.. again with no
improvement.

What am I doing wrong?

--
thx,
jf kaminsky
Nov 21 '05 #1
4 4625
Okay so I think I answered my own question partially anyway. I did the
following:

Bound the Combobox to the Orders table with dataadapter1 with the selected
value set to CustomerID.
Filled the lookup data from Customers table with dataadapter2 and set both
the displaymember and value member to "CustomerID "

right before adding a new row, I set the combobox index to -1 to blank it
out, then the new row is added. I then change to the desired value of
customerID and then call update and acceptchanges.

This seems to work, except that if you do not move off of the combo box and
enter a value in one of the other form controls before calling update, the
new row will NOT be added. It looks like it is, but when you reload the
dataset, there is no new row.

I also added the following to Combobox1_Selec tedIndexChanged
ComboBox1.DataB indings("Select edValue").Bindi ngManagerBase.E ndCurrentEdit()

Just to see what happens... the idea was trying to get the value set when I
selected the new CustomerID. No change. Help!!!
--
thx,
jf kaminsky
"jon f kaminsky" wrote:
Hi-
I've seen this problem discussed a jillion times but I cannot seem to
implement any advice that makes it work. I am porting a large project from
VB6 to .NET. The issue is using the combo box bound to a table as a lookup,
drawing values from another table to populate the available selections. This
all worked fine in VB6.

I have distilled the problem down to a simple form drawing data from the
Northwind database for a representative model so that it can easily be
duplicated by anyone.
1. I use two tables, Orders and Customers. Orders contains a FK from
Customers called CustomerID.
2. Create one form, with text fields bound to columns from the Orders table,
except for Orders.Customer ID. Orders.Customer ID is bound and displayed in the
Combobox. Navigation buttons are used to move around in the orders table,
with buttons to add rows, etc. You can use a wizard to generate this very
easily.
3. The idea is one can add a new order to the Orders table, and make a
selection for the customerID by using a value from the combobox, or change an
existing CustomerID to a different one. The CustomerID values in the
combobox are all populated from the Customers table. Of course, as one
scrolls through orders using the navigation buttons the value displayed in
the combobox changes accordingly, as do the rest of the columns displayed in
the text fields.
4. I have used various means of doing this with various results, all bad.

a. Using one dataadapter and one dataset. Orders table and Customers table
are added to the dataset. All form datafields, including the combobox are
bound to the Orders table with statements similar to the following:
Me.editShipName .DataBindings.A dd(New System.Windows. Forms.Binding(" Text",
Me.dsOrders, "Orders.ShipNam e"))

The Orders table is loaded into the form controls with
SqldataAdapter1 .fill(ds, "Orders"). The Combobox lookup values are the
loaded by Sqldataadapter1 .Fill(ds,"Custo mers") with displaymember set to
CustomerID. This throws an exception regarding nonnull, key restraints
violated. etc. I have tried adding a relation between the tables on
customerID to no avail.

b. I created another dataadapter for just the customer table in order to
load the lookup values. Orders is bound to the controls as before with the
Combobox being loaded by another dataset from datadapter2.fil l:
SqlDataAdapter2 .Fill(custTemp, "Customers" )
ComboBox1.DataS ource = custTemp.Tables (0)
ComboBox1.Displ ayMember = "CustomerID "

This second method works fine- the combo is populated and changes values as
one scrolls through the orders table with with navigation buttons. However,
you cannot change the value in the combobox or add a new row because the
value selected in the combobox just changes back to the orginal value if one
moves to the next record or reloads the dataset. Obviously the change is not
being saved.

c. Same as b, but after the combobox is filled with the CustomerID lookup
values from the Customers table, I rebind the combo to the orginal Order
table with:
ComboBox1.DataB indings.Add("te xt", dsOrders.Tables (0), "CustomerID ") or
ComboBox1.DataB indings.Add("te xt", jdsOrders, "Orders.Custome rID")
Neither have any effect.

I believe I have a currency manager issue. I am doing everything right
except for the combobox. I can even add rows if the combobox is not populated
with the lookup values. I even tried adding:
ComboBox1.Bindi ngContext = New BindingContext
before populating the combobox with the lookup values.. again with no
improvement.

What am I doing wrong?

--
thx,
jf kaminsky

Nov 21 '05 #2
Hi,

Dim dv As DataView

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim strConn As String
Dim da, daOrders As SqlDataAdapter
Dim conn As SqlConnection
Dim ds As New DataSet

strConn = "Server = (local);"
strConn &= "Database = NorthWind; Integrated Security = SSPI;"
conn = New SqlConnection(s trConn)

da = New SqlDataAdapter( "Select * From Customers", conn)
daOrders = New SqlDataAdapter( "Select * From Orders", conn)

da.Fill(ds, "Customers" )
daOrders.Fill(d s, "Orders")

dv = New DataView(ds.Tab les("Orders"))

cboCustomers.Da taSource = ds.Tables("Cust omers")
cboCustomers.Di splayMember = "CompanyNam e"
cboCustomers.Va lueMember = "CustomerID "

dgOrders.DataSo urce = dv
End Sub

Private Sub cboCustomers_Se lectedValueChan ged(ByVal sender As Object,
ByVal e As System.EventArg s) Handles cboCustomers.Se lectedValueChan ged
Try
Dim drv As DataRowView = DirectCast(cboC ustomers.Select edItem,
DataRowView)
dv.RowFilter = String.Format(" CustomerID = '{0}'",
drv.Item("Custo merID"))
Catch ex As Exception

End Try
End Sub
Ken
----------------------
"jon f kaminsky" <jo**********@d iscussions.micr osoft.com> wrote in message
news:37******** *************** ***********@mic rosoft.com...
Hi-
I've seen this problem discussed a jillion times but I cannot seem to
implement any advice that makes it work. I am porting a large project from
VB6 to .NET. The issue is using the combo box bound to a table as a
lookup,
drawing values from another table to populate the available selections.
This
all worked fine in VB6.

I have distilled the problem down to a simple form drawing data from the
Northwind database for a representative model so that it can easily be
duplicated by anyone.
1. I use two tables, Orders and Customers. Orders contains a FK from
Customers called CustomerID.
2. Create one form, with text fields bound to columns from the Orders
table,
except for Orders.Customer ID. Orders.Customer ID is bound and displayed in
the
Combobox. Navigation buttons are used to move around in the orders table,
with buttons to add rows, etc. You can use a wizard to generate this very
easily.
3. The idea is one can add a new order to the Orders table, and make a
selection for the customerID by using a value from the combobox, or change
an
existing CustomerID to a different one. The CustomerID values in the
combobox are all populated from the Customers table. Of course, as one
scrolls through orders using the navigation buttons the value displayed in
the combobox changes accordingly, as do the rest of the columns displayed
in
the text fields.
4. I have used various means of doing this with various results, all bad.

a. Using one dataadapter and one dataset. Orders table and Customers table
are added to the dataset. All form datafields, including the combobox are
bound to the Orders table with statements similar to the following:
Me.editShipName .DataBindings.A dd(New System.Windows. Forms.Binding(" Text",
Me.dsOrders, "Orders.ShipNam e"))

The Orders table is loaded into the form controls with
SqldataAdapter1 .fill(ds, "Orders"). The Combobox lookup values are the
loaded by Sqldataadapter1 .Fill(ds,"Custo mers") with displaymember set to
CustomerID. This throws an exception regarding nonnull, key restraints
violated. etc. I have tried adding a relation between the tables on
customerID to no avail.

b. I created another dataadapter for just the customer table in order to
load the lookup values. Orders is bound to the controls as before with the
Combobox being loaded by another dataset from datadapter2.fil l:
SqlDataAdapter2 .Fill(custTemp, "Customers" )
ComboBox1.DataS ource = custTemp.Tables (0)
ComboBox1.Displ ayMember = "CustomerID "

This second method works fine- the combo is populated and changes values
as
one scrolls through the orders table with with navigation buttons.
However,
you cannot change the value in the combobox or add a new row because the
value selected in the combobox just changes back to the orginal value if
one
moves to the next record or reloads the dataset. Obviously the change is
not
being saved.

c. Same as b, but after the combobox is filled with the CustomerID lookup
values from the Customers table, I rebind the combo to the orginal Order
table with:
ComboBox1.DataB indings.Add("te xt", dsOrders.Tables (0), "CustomerID ") or
ComboBox1.DataB indings.Add("te xt", jdsOrders, "Orders.Custome rID")
Neither have any effect.

I believe I have a currency manager issue. I am doing everything right
except for the combobox. I can even add rows if the combobox is not
populated
with the lookup values. I even tried adding:
ComboBox1.Bindi ngContext = New BindingContext
before populating the combobox with the lookup values.. again with no
improvement.

What am I doing wrong?

--
thx,
jf kaminsky

Nov 21 '05 #3
Thanks Ken for your quick response. I have also got things to work better
with dataviews and grids. Couple of things though. I am not using a datagrid-
all the fields in the Orders table are bound individually to textboxes on the
form, except for Orders.Customer ID, it is displayed in a combobox.
Unfortunately, my real project, for which I am using the Northwind database
to model the interaction, is not using views and datagrids. My real project
is also different on the field that is modeled with CustomerID. The
displaymember and value member are one and the same. Sort of like having zip
codes stored in a combo - the displayed value IS the data. These differences
somehow contribute to the problems I am experiencing.

if you have any more input, I would sure like to read it.

Thanks
Jon
--
thx,
jf kaminsky
"Ken Tucker [MVP]" wrote:
Hi,

Dim dv As DataView

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim strConn As String
Dim da, daOrders As SqlDataAdapter
Dim conn As SqlConnection
Dim ds As New DataSet

strConn = "Server = (local);"
strConn &= "Database = NorthWind; Integrated Security = SSPI;"
conn = New SqlConnection(s trConn)

da = New SqlDataAdapter( "Select * From Customers", conn)
daOrders = New SqlDataAdapter( "Select * From Orders", conn)

da.Fill(ds, "Customers" )
daOrders.Fill(d s, "Orders")

dv = New DataView(ds.Tab les("Orders"))

cboCustomers.Da taSource = ds.Tables("Cust omers")
cboCustomers.Di splayMember = "CompanyNam e"
cboCustomers.Va lueMember = "CustomerID "

dgOrders.DataSo urce = dv
End Sub

Private Sub cboCustomers_Se lectedValueChan ged(ByVal sender As Object,
ByVal e As System.EventArg s) Handles cboCustomers.Se lectedValueChan ged
Try
Dim drv As DataRowView = DirectCast(cboC ustomers.Select edItem,
DataRowView)
dv.RowFilter = String.Format(" CustomerID = '{0}'",
drv.Item("Custo merID"))
Catch ex As Exception

End Try
End Sub
Ken
----------------------
"jon f kaminsky" <jo**********@d iscussions.micr osoft.com> wrote in message
news:37******** *************** ***********@mic rosoft.com...
Hi-
I've seen this problem discussed a jillion times but I cannot seem to
implement any advice that makes it work. I am porting a large project from
VB6 to .NET. The issue is using the combo box bound to a table as a
lookup,
drawing values from another table to populate the available selections.
This
all worked fine in VB6.

I have distilled the problem down to a simple form drawing data from the
Northwind database for a representative model so that it can easily be
duplicated by anyone.
1. I use two tables, Orders and Customers. Orders contains a FK from
Customers called CustomerID.
2. Create one form, with text fields bound to columns from the Orders
table,
except for Orders.Customer ID. Orders.Customer ID is bound and displayed in
the
Combobox. Navigation buttons are used to move around in the orders table,
with buttons to add rows, etc. You can use a wizard to generate this very
easily.
3. The idea is one can add a new order to the Orders table, and make a
selection for the customerID by using a value from the combobox, or change
an
existing CustomerID to a different one. The CustomerID values in the
combobox are all populated from the Customers table. Of course, as one
scrolls through orders using the navigation buttons the value displayed in
the combobox changes accordingly, as do the rest of the columns displayed
in
the text fields.
4. I have used various means of doing this with various results, all bad.

a. Using one dataadapter and one dataset. Orders table and Customers table
are added to the dataset. All form datafields, including the combobox are
bound to the Orders table with statements similar to the following:
Me.editShipName .DataBindings.A dd(New System.Windows. Forms.Binding(" Text",
Me.dsOrders, "Orders.ShipNam e"))

The Orders table is loaded into the form controls with
SqldataAdapter1 .fill(ds, "Orders"). The Combobox lookup values are the
loaded by Sqldataadapter1 .Fill(ds,"Custo mers") with displaymember set to
CustomerID. This throws an exception regarding nonnull, key restraints
violated. etc. I have tried adding a relation between the tables on
customerID to no avail.

b. I created another dataadapter for just the customer table in order to
load the lookup values. Orders is bound to the controls as before with the
Combobox being loaded by another dataset from datadapter2.fil l:
SqlDataAdapter2 .Fill(custTemp, "Customers" )
ComboBox1.DataS ource = custTemp.Tables (0)
ComboBox1.Displ ayMember = "CustomerID "

This second method works fine- the combo is populated and changes values
as
one scrolls through the orders table with with navigation buttons.
However,
you cannot change the value in the combobox or add a new row because the
value selected in the combobox just changes back to the orginal value if
one
moves to the next record or reloads the dataset. Obviously the change is
not
being saved.

c. Same as b, but after the combobox is filled with the CustomerID lookup
values from the Customers table, I rebind the combo to the orginal Order
table with:
ComboBox1.DataB indings.Add("te xt", dsOrders.Tables (0), "CustomerID ") or
ComboBox1.DataB indings.Add("te xt", jdsOrders, "Orders.Custome rID")
Neither have any effect.

I believe I have a currency manager issue. I am doing everything right
except for the combobox. I can even add rows if the combobox is not
populated
with the lookup values. I even tried adding:
ComboBox1.Bindi ngContext = New BindingContext
before populating the combobox with the lookup values.. again with no
improvement.

What am I doing wrong?

--
thx,
jf kaminsky


Nov 21 '05 #4
Hi,

You could still bind the combobox with the orders to a dataview
and filter the records for that.

Ken
---------------------
"jon f kaminsky" <jo**********@d iscussions.micr osoft.com> wrote in message
news:5A******** *************** ***********@mic rosoft.com...
Thanks Ken for your quick response. I have also got things to work better
with dataviews and grids. Couple of things though. I am not using a
datagrid-
all the fields in the Orders table are bound individually to textboxes on
the
form, except for Orders.Customer ID, it is displayed in a combobox.
Unfortunately, my real project, for which I am using the Northwind
database
to model the interaction, is not using views and datagrids. My real
project
is also different on the field that is modeled with CustomerID. The
displaymember and value member are one and the same. Sort of like having
zip
codes stored in a combo - the displayed value IS the data. These
differences
somehow contribute to the problems I am experiencing.

if you have any more input, I would sure like to read it.

Thanks
Jon
--
thx,
jf kaminsky
"Ken Tucker [MVP]" wrote:
Hi,

Dim dv As DataView

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim strConn As String
Dim da, daOrders As SqlDataAdapter
Dim conn As SqlConnection
Dim ds As New DataSet

strConn = "Server = (local);"
strConn &= "Database = NorthWind; Integrated Security = SSPI;"
conn = New SqlConnection(s trConn)

da = New SqlDataAdapter( "Select * From Customers", conn)
daOrders = New SqlDataAdapter( "Select * From Orders", conn)

da.Fill(ds, "Customers" )
daOrders.Fill(d s, "Orders")

dv = New DataView(ds.Tab les("Orders"))

cboCustomers.Da taSource = ds.Tables("Cust omers")
cboCustomers.Di splayMember = "CompanyNam e"
cboCustomers.Va lueMember = "CustomerID "

dgOrders.DataSo urce = dv
End Sub

Private Sub cboCustomers_Se lectedValueChan ged(ByVal sender As Object,
ByVal e As System.EventArg s) Handles cboCustomers.Se lectedValueChan ged
Try
Dim drv As DataRowView =
DirectCast(cboC ustomers.Select edItem,
DataRowView)
dv.RowFilter = String.Format(" CustomerID = '{0}'",
drv.Item("Custo merID"))
Catch ex As Exception

End Try
End Sub
Ken
----------------------
"jon f kaminsky" <jo**********@d iscussions.micr osoft.com> wrote in
message
news:37******** *************** ***********@mic rosoft.com...
> Hi-
> I've seen this problem discussed a jillion times but I cannot seem to
> implement any advice that makes it work. I am porting a large project
> from
> VB6 to .NET. The issue is using the combo box bound to a table as a
> lookup,
> drawing values from another table to populate the available selections.
> This
> all worked fine in VB6.
>
> I have distilled the problem down to a simple form drawing data from
> the
> Northwind database for a representative model so that it can easily be
> duplicated by anyone.
> 1. I use two tables, Orders and Customers. Orders contains a FK from
> Customers called CustomerID.
> 2. Create one form, with text fields bound to columns from the Orders
> table,
> except for Orders.Customer ID. Orders.Customer ID is bound and displayed
> in
> the
> Combobox. Navigation buttons are used to move around in the orders
> table,
> with buttons to add rows, etc. You can use a wizard to generate this
> very
> easily.
> 3. The idea is one can add a new order to the Orders table, and make a
> selection for the customerID by using a value from the combobox, or
> change
> an
> existing CustomerID to a different one. The CustomerID values in the
> combobox are all populated from the Customers table. Of course, as one
> scrolls through orders using the navigation buttons the value displayed
> in
> the combobox changes accordingly, as do the rest of the columns
> displayed
> in
> the text fields.
> 4. I have used various means of doing this with various results, all
> bad.
>
> a. Using one dataadapter and one dataset. Orders table and Customers
> table
> are added to the dataset. All form datafields, including the combobox
> are
> bound to the Orders table with statements similar to the following:
> Me.editShipName .DataBindings.A dd(New
> System.Windows. Forms.Binding(" Text",
> Me.dsOrders, "Orders.ShipNam e"))
>
> The Orders table is loaded into the form controls with
> SqldataAdapter1 .fill(ds, "Orders"). The Combobox lookup values are the
> loaded by Sqldataadapter1 .Fill(ds,"Custo mers") with displaymember set
> to
> CustomerID. This throws an exception regarding nonnull, key restraints
> violated. etc. I have tried adding a relation between the tables on
> customerID to no avail.
>
> b. I created another dataadapter for just the customer table in order
> to
> load the lookup values. Orders is bound to the controls as before with
> the
> Combobox being loaded by another dataset from datadapter2.fil l:
> SqlDataAdapter2 .Fill(custTemp, "Customers" )
> ComboBox1.DataS ource = custTemp.Tables (0)
> ComboBox1.Displ ayMember = "CustomerID "
>
> This second method works fine- the combo is populated and changes
> values
> as
> one scrolls through the orders table with with navigation buttons.
> However,
> you cannot change the value in the combobox or add a new row because
> the
> value selected in the combobox just changes back to the orginal value
> if
> one
> moves to the next record or reloads the dataset. Obviously the change
> is
> not
> being saved.
>
> c. Same as b, but after the combobox is filled with the CustomerID
> lookup
> values from the Customers table, I rebind the combo to the orginal
> Order
> table with:
> ComboBox1.DataB indings.Add("te xt", dsOrders.Tables (0), "CustomerID ") or
> ComboBox1.DataB indings.Add("te xt", jdsOrders, "Orders.Custome rID")
> Neither have any effect.
>
> I believe I have a currency manager issue. I am doing everything right
> except for the combobox. I can even add rows if the combobox is not
> populated
> with the lookup values. I even tried adding:
> ComboBox1.Bindi ngContext = New BindingContext
> before populating the combobox with the lookup values.. again with no
> improvement.
>
> What am I doing wrong?
>
> --
> thx,
> jf kaminsky


Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3458
by: Phil | last post by:
My form uses a dataset containing two tables, a base table (Contact) and a lookup table (Insurer). My combobox is bound as follows: DataSource = datasetContact DisplayMember = Insurer.InsurerName ValueMember = Insurer.InsurerId DataBindings.SelectedValue = Contact.InsurerId It generally works fine. I am able to navigate records and
5
2606
by: Greg Dunn | last post by:
I have two tables in a parent-child relationship. Details on the tables are as shown below: Table1 ------- Item_ID (primary key) Item_Owner (foreign key to Table2) Table2 -------
5
4667
by: Aaron Ackerman | last post by:
I have a bound combobox the appears on a cell within the column of my bound grid when the user clicks on a cell n(In my vb.net WinForm app). I am trying to allow the adding of an item to that bound combo by allowing the user to dynamically type in the new value directly in the combo box whcih in turn updates the lookup table and then when they have finished leaves that particular cell on the grid with the correct value. Seems...
30
4620
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a corresponding field in the lookup table. In my data table we store the ID in what I will call the 'key' field. == Description of the desired operation:
6
2885
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox and the coresponding 'Id' from the lookup table is to be inserted into the field of the new record. I have two simple tables. "tblPerson" is the data table. The lookup
3
6737
by: Magnus | last post by:
Im using a set combobox (ComboBox1) to provide a selection of records from a database table. I have a typed dataset (DataSet1) that contains the typed datatable (DataTable1) that the combobox is bound to. The datatable in the dataset is filled using the typed tableadapter (TableAdapter1). DataTable consists of the typical primary key and value fields. Here is the designer generated code for ComboBox1: this.ComboBox1.DataSource =...
0
2023
by: Frnak McKenney | last post by:
Can I use a bound ComboBox for both browsing and editing? I'm working on a small, standalone database application using Visual C#.NET 2003 and an Access data file. In order to keep the number of different screens down to a minimum, I'm trying to use the same Windows Forms for both browsing and for updating. This works fine for TextBoxes, but I'm running into problems with my DropDownLists (ComboBoxes).
19
2214
by: active | last post by:
I'm using a ComboBox to display objects of a class I've defined, say CQQ. Works great except somehow I occasionally set an Item to a String object instead of an object of type CQQ. It looks like Text replaces an item or something like that. This results in a runtime error at which time I learn that the item that should be CQQ is a String.
1
1776
by: Robert Dufour | last post by:
I have a table of addresses and it contains a CountryId which points to a table of countries. The datatstructure of the Countries Lookup tables is actually created from three tables - a CountryIdtable - a Countries localized tables and an cultures tables From which I extract a dataset select CountryID - CountryName - Culture name (with inner joins between the three) where CultureName = CurrentCulture.CurrentUiCulture.tostring. So I would...
0
9766
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10702
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10800
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9536
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7934
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5763
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4584
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4177
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.