how to create .xml file using SQL query (SQL Server 2000)  
Author Message
phanikumarkvr





PostPosted: .NET Framework Data Access and Storage, how to create .xml file using SQL query (SQL Server 2000) Top

i'm using a datawarehouse from which i need to pickup huge data and show it using a grid on a web page.

my thought is to create an .xml file suing SQL query and then create a dataset from the XML file and then bind it to a datagrid

do any one have any better(best) approach for this

 



.NET Development31  
 
 
alazela





PostPosted: .NET Framework Data Access and Storage, how to create .xml file using SQL query (SQL Server 2000) Top

What format is the data in the warehouse If you can pull it out using a standard ADO.Net provider, then you can push that directly into a dataset for binding.

Another question to think about: Why do you need huge data in a grid Maybe just a subset of the data that is relevant to the current display is all you need



 
 
phanikumarkvr





PostPosted: .NET Framework Data Access and Storage, how to create .xml file using SQL query (SQL Server 2000) Top

actually the requirement is like this:

1) Its a migration project from asp to .net with many enhancements in the application.

2) clients already designed the DB. we should not make any changes to DB.

3) i have a stored procedure which returns 26000 rows with 24 columns. This data needs to be populated in a grid for client's reference.

that is why.. I want to create a .xml file from stored procedure and create a dataset from XML file and bind the grid with dataset

do u have any best idea for doing it


 
 
AnKor





PostPosted: .NET Framework Data Access and Storage, how to create .xml file using SQL query (SQL Server 2000) Top

I don't see any advantages in creating intermediate XML file
What stops you from populating dataset directly from the query with DataAdapter for instance

Of course query results can be returned as xml if you append FOR XML AUTO clause to select statement, but I'm not sure how are you going to use it anyway.

 
 
alazela





PostPosted: .NET Framework Data Access and Storage, how to create .xml file using SQL query (SQL Server 2000) Top

If you really must have an intermediate XML file, you could also populate a dataset (via dataAdapter), then serialize that dataset, producing the XML.

 
 
phanikumarkvr





PostPosted: .NET Framework Data Access and Storage, how to create .xml file using SQL query (SQL Server 2000) Top

actually we are approaching a layered architecture... so i need to pass this dataset from data layaer to UI layer (thru business layer and thru service layer - these are intermediate layers). It comsumes more time (in a web application scenario) .. right

that is why if i'm able to create a file from Stored procedure... then directly from UI i can access the file to populate the dataset and then can bind the grid

do you think this is a right option otherwise how do you approach in a layered architecture

its urgent .. awaiting ur reply...


 
 
CommonGenius.com





PostPosted: .NET Framework Data Access and Storage, how to create .xml file using SQL query (SQL Server 2000) Top

Your best bet is probably still the DataGrid, which can be serialized back and forth between layers. Why are you reluctant to do that