Has anyone ever done this? I've had a brief look around and couldn't find any examples in LINQ.
If someone has done this or knows it's not possible, I'd love to know before I waste too much time looking into it.
Thanks in advance.
3 Replies - 2758 Views - Last Post: 06 June 2012 - 06:19 PM
#1
Creating a new SQL database from XML using LINQ to SQL (in C#)
Posted 06 June 2012 - 05:43 PM
Replies To: Creating a new SQL database from XML using LINQ to SQL (in C#)
#2
Re: Creating a new SQL database from XML using LINQ to SQL (in C#)
Posted 06 June 2012 - 05:47 PM
How about you explain a bit more on what you are asking to do. Are the table definitions in the XML and you want to create that in a MsSQL db, or what?
#3
Re: Creating a new SQL database from XML using LINQ to SQL (in C#)
Posted 06 June 2012 - 06:04 PM
To be a little more specific,
I have a web service which is supplying me a schema (portion below) and what I'm thinking is that instead of parsing the XML and building and holding it in a data structure (or in a file) I might be better off using the schema to create a full database.
The reason I'm specifically looking for LINQ solutions is that the database would be SQL CE (WP7) which does not allow T-SQL interaction, but only LINQ to SQL.
I have a web service which is supplying me a schema (portion below) and what I'm thinking is that instead of parsing the XML and building and holding it in a data structure (or in a file) I might be better off using the schema to create a full database.
The reason I'm specifically looking for LINQ solutions is that the database would be SQL CE (WP7) which does not allow T-SQL interaction, but only LINQ to SQL.
<return xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" xmlns:xlink="http://www.w3.org/1999/xlink">
<service_response service="application_schema" request="schema" request_id="566556" session_id="565665">
<schema>
<database>
<dataset internalName="data" externalName="DATA">
<xsd:schema>
<xsd:import namespace="xxxxxxxx" />
<xsd:element name="gis.function_texts" gml:name="Function Texts" type="gml:gis.function_textsType" substitutionGroup="gml:_Feature" />
<xsd:complexType name="gis.function_textsType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element name="text_1" sw:name="text_1" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_2" sw:name="text_2" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_3" sw:name="text_3" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_4" sw:name="text_4" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_5" sw:name="text_5" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_6" sw:name="text_6" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_7" sw:name="text_7" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_8" sw:name="text_8" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_9" sw:name="text_9" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_10" sw:name="text_10" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_11" sw:name="text_11" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_12" sw:name="text_12" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_13" sw:name="text_13" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_14" sw:name="text_14" minOccurs="0" type="gml:GeometryPropertyType" />
<xsd:element name="text_15" sw:name="text_15" minOccurs="0" type="gml:GeometryPropertyType" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
</dataset>
</database>
</schema>
</service_response>
</return>
#4
Re: Creating a new SQL database from XML using LINQ to SQL (in C#)
Posted 06 June 2012 - 06:19 PM
This might help:
http://msdn.microsof...y/bb399420.aspx
It requires knowing the schema at compile-time, but it'll generate a DB on demand.
http://msdn.microsof...y/bb399420.aspx
It requires knowing the schema at compile-time, but it'll generate a DB on demand.
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote






|