DataSet en MS Access

G

Guest

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
 
M

Mary Chipman [MSFT]

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
 
G

Guest

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
 
M

Mary Chipman [MSFT]

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
 
G

Guest

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?
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top