|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DataSet en MS AccessHi,
I'm using Visual Studio .NET 2005 and .Net framework 2.0 I have a DataSet with data from an MS Access database table. In the MS Access database is a tablefield with a Display Control. This Display Control is set as Combo Box. But when I look at the DataType in my DataTable it returns System.String Is there anyway to get the Row Source from the MS Access table by using a DataTable, DataView or ....? Or do i have to use DAO to get this information. Thanx Foef Access uses extended properties to indicate how data should be
displayed when using msaccess.exe. It isn't applicable outside of the Access UI. Why do you need display control information in a DataTable? --Mary On Wed, 9 Aug 2006 09:19:02 -0700, Foef <F***@discussions.microsoft.com> wrote: Show quote >Hi, > >I'm using Visual Studio .NET 2005 and .Net framework 2.0 >I have a DataSet with data from an MS Access database table. >In the MS Access database is a tablefield with a Display Control. >This Display Control is set as Combo Box. > >But when I look at the DataType in my DataTable it returns System.String > >Is there anyway to get the Row Source from the MS Access table by using a >DataTable, DataView or ....? >Or do i have to use DAO to get this information. > >Thanx >Foef I'm filling a DataGridView in code based on the columns in the DataTable.
So, if there is a field in MS Access set as ComboBox I want to add a combobox field basid on the settings in MS Access. Because MS Access has also a property which shows the linked table. Thanx, Foef Show quote "Mary Chipman [MSFT]" wrote: > Access uses extended properties to indicate how data should be > displayed when using msaccess.exe. It isn't applicable outside of the > Access UI. Why do you need display control information in a DataTable? > > --Mary > > On Wed, 9 Aug 2006 09:19:02 -0700, Foef > <F***@discussions.microsoft.com> wrote: > > >Hi, > > > >I'm using Visual Studio .NET 2005 and .Net framework 2.0 > >I have a DataSet with data from an MS Access database table. > >In the MS Access database is a tablefield with a Display Control. > >This Display Control is set as Combo Box. > > > >But when I look at the DataType in my DataTable it returns System.String > > > >Is there anyway to get the Row Source from the MS Access table by using a > >DataTable, DataView or ....? > >Or do i have to use DAO to get this information. > > > >Thanx > >Foef > Normally the combo box property is set for foreign keys, such as
CategoryID in the products table where you want to display the name of the category, not the ID. You could perhaps take the indirect approach and use the schema information that you can retrieve easily to deduce where the drop-down lists should occur. You'd need it anyway to display the relevant data. --Mary On Fri, 18 Aug 2006 04:01:01 -0700, Foef <F***@discussions.microsoft.com> wrote: Show quote >I'm filling a DataGridView in code based on the columns in the DataTable. >So, if there is a field in MS Access set as ComboBox I want to add a >combobox field basid on the settings in MS Access. >Because MS Access has also a property which shows the linked table. > > >Thanx, >Foef > >"Mary Chipman [MSFT]" wrote: > >> Access uses extended properties to indicate how data should be >> displayed when using msaccess.exe. It isn't applicable outside of the >> Access UI. Why do you need display control information in a DataTable? >> >> --Mary >> >> On Wed, 9 Aug 2006 09:19:02 -0700, Foef >> <F***@discussions.microsoft.com> wrote: >> >> >Hi, >> > >> >I'm using Visual Studio .NET 2005 and .Net framework 2.0 >> >I have a DataSet with data from an MS Access database table. >> >In the MS Access database is a tablefield with a Display Control. >> >This Display Control is set as Combo Box. >> > >> >But when I look at the DataType in my DataTable it returns System.String >> > >> >Is there anyway to get the Row Source from the MS Access table by using a >> >DataTable, DataView or ....? >> >Or do i have to use DAO to get this information. >> > >> >Thanx >> >Foef >> I'm using the schema information.
I have used: Dim schemaTable As DataTable = connection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, _ New Object() {Nothing, Nothing, Nothing, "TABLE"}) and also: OleDbDataAdapter.FillSchema(DataSet, SchemaType.Source, TableName) I have looked on the internet and almost everybody uses this but how do I get my information from this datatable? I can not find any method or property like: schemaTable.DisplayControl = "Combobox" So, how do I get my information from the schema information? Show quote "Mary Chipman [MSFT]" wrote: > Normally the combo box property is set for foreign keys, such as > CategoryID in the products table where you want to display the name of > the category, not the ID. You could perhaps take the indirect approach > and use the schema information that you can retrieve easily to deduce > where the drop-down lists should occur. You'd need it anyway to > display the relevant data. > > --Mary > > On Fri, 18 Aug 2006 04:01:01 -0700, Foef > <F***@discussions.microsoft.com> wrote: > > >I'm filling a DataGridView in code based on the columns in the DataTable. > >So, if there is a field in MS Access set as ComboBox I want to add a > >combobox field basid on the settings in MS Access. > >Because MS Access has also a property which shows the linked table. > > > > > >Thanx, > >Foef > > > >"Mary Chipman [MSFT]" wrote: > > > >> Access uses extended properties to indicate how data should be > >> displayed when using msaccess.exe. It isn't applicable outside of the > >> Access UI. Why do you need display control information in a DataTable? > >> > >> --Mary > >> > >> On Wed, 9 Aug 2006 09:19:02 -0700, Foef > >> <F***@discussions.microsoft.com> wrote: > >> > >> >Hi, > >> > > >> >I'm using Visual Studio .NET 2005 and .Net framework 2.0 > >> >I have a DataSet with data from an MS Access database table. > >> >In the MS Access database is a tablefield with a Display Control. > >> >This Display Control is set as Combo Box. > >> > > >> >But when I look at the DataType in my DataTable it returns System.String > >> > > >> >Is there anyway to get the Row Source from the MS Access table by using a > >> >DataTable, DataView or ....? > >> >Or do i have to use DAO to get this information. > >> > > >> >Thanx > >> >Foef > >> > I have found some properties with the next code:
For Each rw As DataRow In schemaTable.Rows But it does not show me the properties like: DisplayControl RowSourceType RowSOurce BoundColumn etc. This are the properties in MS Access in the tab 'Lookup' when you have a table in design mode. Show quote "Mary Chipman [MSFT]" wrote: > Normally the combo box property is set for foreign keys, such as > CategoryID in the products table where you want to display the name of > the category, not the ID. You could perhaps take the indirect approach > and use the schema information that you can retrieve easily to deduce > where the drop-down lists should occur. You'd need it anyway to > display the relevant data. > > --Mary > > On Fri, 18 Aug 2006 04:01:01 -0700, Foef > <F***@discussions.microsoft.com> wrote: > > >I'm filling a DataGridView in code based on the columns in the DataTable. > >So, if there is a field in MS Access set as ComboBox I want to add a > >combobox field basid on the settings in MS Access. > >Because MS Access has also a property which shows the linked table. > > > > > >Thanx, > >Foef > > > >"Mary Chipman [MSFT]" wrote: > > > >> Access uses extended properties to indicate how data should be > >> displayed when using msaccess.exe. It isn't applicable outside of the > >> Access UI. Why do you need display control information in a DataTable? > >> > >> --Mary > >> > >> On Wed, 9 Aug 2006 09:19:02 -0700, Foef > >> <F***@discussions.microsoft.com> wrote: > >> > >> >Hi, > >> > > >> >I'm using Visual Studio .NET 2005 and .Net framework 2.0 > >> >I have a DataSet with data from an MS Access database table. > >> >In the MS Access database is a tablefield with a Display Control. > >> >This Display Control is set as Combo Box. > >> > > >> >But when I look at the DataType in my DataTable it returns System.String > >> > > >> >Is there anyway to get the Row Source from the MS Access table by using a > >> >DataTable, DataView or ....? > >> >Or do i have to use DAO to get this information. > >> > > >> >Thanx > >> >Foef > >> > |
|||||||||||||||||||||||