 |
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

September 19th, 2004, 11:38 PM
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Creating a new table from a dataset...
How can I create a new table from dataset which has been filled from a xml file...?
In fact I found no way ,so I did it manually,I mean retrieved name of dataset table columns one by one and created then filled the SQL table,but I has two main problems:
1.The code is not that much beautiful!!
2.When there exists a string cell in table where contain ('),the query string will be unacceptable for SQL cause it contains a useless (') in the query like:
INSERT INTO tablename VALUES ('La maison d'Asie');
How can i fix the problem?
|

September 20th, 2004, 01:16 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi,
1) You haven't mentioned anything on, if you are using ASP or ASP.Net.
2) You can always replace (') with double ('')s in that case to get that work.
You would better take a look at the OPENXML statement, that would be of some help in this.
Cheers!
_________________________
- Vijay G
Strive for Perfection
|

September 20th, 2004, 08:21 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
You talking about creating a table at the database level, or within the dataset?
Brian
|

September 21st, 2004, 01:42 AM
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
I meant creating a table at the database level FROM a table within a dataset.
There are lots of problem cause,when a table is written in XML format then read to a dataset from the xml document ,the Column Types of the dataset table and database table does not match,so there maybe some kinds of column types missed during the read and write to and from the xml document to the dataset table and database table...,so if there existed an predefined way ,these problem s could be solved,but I have not found this yet...
And Vijay ,I forgot to mention that I'm doing in ASP.NET.
Thanks
|

September 21st, 2004, 07:41 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
I don't think you can just do it from a data set, you would have to create a dynamic create table script, which you would need major permissions.
Brian
|
|
 |