Problem with the D4 ADO provider


Steve Dassin says:-

"If you are truely a beginner then your brain hasn't been filled with
glue yet.
For application development check out Dataphor. "

I am not yet proficient with SQL, and I'd like to avoid becoming
proficient with it. There are enough frustrated intellectuals banging
on about how inadequate it is for me to be virtually certain they're
right about Dataphor.

However, in this post:-

Lauri says:-

" > I think an implementor would be better off using an SQL database

> underneath, and using their code layer in between to accomplish the
> "divorce" from the aspects of SQL that they disapprove of.

That is, in fact, the approach taken in a product called Dataphor
(see They have implemented a "D"-language (called
that translates into SQL and hence uses underlying SQLServer, Oracle
or DB2- DBMS'es as the engine.

It is, however, not a very easy mapping to do and you have to resort
to all sorts of unclean stuff to make it work...

Lauri Pietarinen"

and he's right. Like Lauri says, it aint easy.

The documentation is skeletal for the "DAC provider" and almost non
existent for the ADO provider, both of which I am trying to get
working. With the ADO provider I am trying both an untyped and typed
dataset grid view in a windows form.

I have been getting a few helpful nudges from people involved with or
using D4, but I need further help to get the providers working. Things
are getting so bad that I may soon be forced to learn SQL.

Anyone know if there are any suitable forums for support with this
apart from this one?

Below is an outline of the problem I am having with the ADO provider.


I have two datagrid views, two datasets both set to the same table in
the DBMS.

When I change a data row value in the first data gridview, I want it
to appear in the second data gridview.

DaeDataAdapter1.Update(DataSet2, "jobs")

gives me repeated sets of data, because the schema information
indicating key columns is missing.


So, to fill the table column schema:-

DaeDataAdapter1.FillSchema(DataSet2, SchemaType.Source, "jobs")


DaeDataAdapter1.MissingSchemaAction = MissingSchemaAction.AddWithKey

which both give this error:-

"Type of value has a mismatch with column type Couldn't store
in ProviderType Column. Expected type is Type."

1) The table column schema is the table attached to a data table
that describes the properties of the columns, with the column names
recorded as rows, and the properties of columns listed as attributes
in the table.

2) The provider type column in the table column schema is a
column which describes the type as it is referred to by the provider/
DBMS being referenced.

3) Therefore the table column schema "provider type" column data
type would normally be "type"

4) The Dataphor ADO provider is trying to fill this with a
"system.short" type and not a "type" type

5) The provider is therefore asking the dataset to record the
provider's datatype as some sort of numerical reference (for
conversions to DBMS recognized data types during updates/inserts?)

6) Therefore dataphor refers to its pool of data types by a
numerical reference.

Hope that makes sense. Am I thinking along the right lines here?

The data type of the type column in the column schema is clearly
"type", so why is the dataphor datadapter trying to fill it with

How could the attempt to specify the type of the providertype column a
"system.short" be otherwise explained?

And how would one get ADO datasets to allow Dataphor's type
references? A custom dataset object/control/class, perhaps?

Is there any better terminology for this than "Table column schema
providertype column data type"?



Steve B.

A Workaround

Unfortunately, the FillSchema problem is going to require a change to the Provider, which we cannot do (without rewriting the whole thing). The good news is that the FillSchema is just an automatic way of building the key information for the table, and you can add it yourself (which you already knew of course). So here is the vb for doing that:

DataSet2.Tables("jobs").PrimaryKey = New DataColumn() {DataSet2.Tables("jobs").Columns("job_id")}

The PrimaryKey property is of type ‘array of DataColumn’, so you can’t just assign it an instance of a DataColumn class, you have to assign an instance of an array of DataColumns, which is what this New DataColumn() { … } syntax is doing. It’s actually quite similar to a list selector in D4.

Bryn Rhodes
Database Consulting Group LLC

Workaround successful

OK, workaround implemented.

All appears to be well for now. Data is being happily updated.

Thanks again for your help.

Steve B.