Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old September 19th, 2004, 11:38 PM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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?
  #2 (permalink)  
Old September 20th, 2004, 01:16 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
  #3 (permalink)  
Old September 20th, 2004, 08:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

You talking about creating a table at the database level, or within the dataset?

Brian
  #4 (permalink)  
Old September 21st, 2004, 01:42 AM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
  #5 (permalink)  
Old September 21st, 2004, 07:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating xslt from dataset in .net sudhir164 .NET Framework 2.0 2 December 4th, 2007 12:16 AM
Creating DataSet/DataTable from XML hhmoeller XML 4 March 22nd, 2006 10:41 AM
Creating a Crystal Report from a runtime dataset vbmazza ASP.NET 1.0 and 1.1 Basics 0 March 17th, 2006 07:40 AM
Creating table with existing table without value kumar_kumar Oracle 1 January 4th, 2005 07:12 AM
Creating reports using dataset Bhavin Crystal Reports 0 October 27th, 2004 02:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.