Re: DataSet to Access Database

Tech-Archive recommends: Fix windows errors by optimizing your registry



Cor,

Thank you for the link. I have noticed that "Memo" field in the Access
database has been turned into "xs:string" in the schema section of the XML
file. So when I construct create table request [col name] TEXT (536870910);
passing maxLength value, I get an error message saying "col name" is too
large. So, I guess I should have sent [col name] Memo in this case. But my
question is, if I see in the XML schema, a child nodes data type is
"xs:string" and length is > 255, is it a Memo field in the Access database?

Is there any other similar assumptions I have to make while converting data
types from XML schema to access data types?

- <xs:restriction base="xs:string">
<xs:maxLength value="536870910" />
</xs:restriction>

I have an object "dt" of DataTable of the empty access database, first I
create the table by looping through all the tables from dataset (from XML)
(outer For loop) and inside that I copy DataRow from dataset to dt (inner For
loop).

' create empty access database
dbCatalog.Create(strCmd)

' get a handler to db connection and open it
dbConn = New OleDbConnection(strCmd)
dbConn.Open()

' get the DataTable
dt = dbConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, New Object()
{Nothing, Nothing, Nothing, Nothing})

For i As Integer = 0 To dataset.Tables.Count - 1
< create table in the Access database>
Dim row As DataRow
For j As Integer = 0 To datatable.Rows.Count - 1
row = dt.NewRow()
dt.Rows.InsertAt(datatable.Rows.Item(j), j)
Next j
dt.AcceptChanges()
Next i

dbConn.Close()
dbCatalog = Nothing
dbConn = Nothing
dt = Nothing

What am I missing here? I am sure there is... because I can only see that
the tables are created in the Access database without any rows. Could you
please point me the errors?

Regards
Sanjib

"Cor Ligthert [MVP]" wrote:

> Sanjib,
>
> > Thank you for the prompt reply. Is there any plan to have this feature
> > included in the future version of .Net?
>
> Not that I know.
>
> The information you are looking for is probably in this page.
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatacolumnmemberstopic.asp
>
> I hope this helps,
>
> Cor
>
>
>
.



Relevant Pages

  • RE: Data Insertion
    ... >The physical database structure is already in place. ... >I can determine the XML file and whether it contains a schema. ... In this particular case XML Schema is used to create a DataSet schema (set ... you're probably wondering how it's possible to load XML without XML ...
    (microsoft.public.dotnet.framework.compactframework)
  • RE: Data Insertion
    ... I can determine the XML file and whether it contains a schema. ... If it is intended to generate the database itself, ... To simplify ..If I have an XML file with a schema could you clarify what steps I follow to get it into the database. ...
    (microsoft.public.dotnet.framework.compactframework)
  • RE: from XML to SqlCE
    ... you can load the XML into a data set and then into SQL CE. ... as there is no way for the dataset to create the database schema on the fly. ...
    (microsoft.public.sqlserver.ce)
  • Schema mapping problem
    ... Receiving schema gets data from ms sql2000 db as xml data and produces output to a txt file. ... This second schema can not get any data values when receiving schema gets data from database. ... when I change receiving schema to get data from xml file then second schema also works. ...
    (microsoft.public.biztalk.general)
  • Re: how to return xml document from a web service
    ... what specific XML you expect. ... If you have a schema that defines what you expect, ... The second issue with this approach is that XML is not a string. ... >> methods from the wire transport. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)