May 29, 2010 at 5:01 am
HI
i created a following table
Create table TB_DiscountLevel(DL_ID INT IDENTITY(1,1),DL_CategoryPercent int ,DL_CategoryFlat int,
DL_SubCategory1Percent int,DL_SubCategory1Flat int,DL_SubCategory2Percent int,DL_SubCategory2Flat int)
i want to store the data whatever inserted to the Table TB_Discount as a Xml file at server side in sqlserver 2005 & client side in c#
May 29, 2010 at 1:13 pm
Please provide ready to use sample data and your requested result based on those data.
Alternatively you could look into bcp for exporting data together with FOR XML (PATH/AUTO/RAW/EXPLICIT) to transform the relational data into an xml format.
May 29, 2010 at 2:35 pm
every dataTable and dataSet in .NET has the ability to .ReadXML and .WriteXML.
you can add a .xsd DataSet to your project, and drag and drop an one or more existing tables from Server Explorer to your DataSet.
you could then .WriteXML to a file or stream to save the schema and it's data to xml. I've done this to a file many times; it's possible to then reload the xmlfile later;
is that what you were after?
Lowell
May 31, 2010 at 12:24 am
THank you for your reply..
But i want to store or export xml file to local machine PLease answer me
May 31, 2010 at 6:33 am
Your response is very misleading...you said you were building an application in c#; that application is a Windows Application right? Based on that, I inferred you had some familiarity with an application that runs locally, but connects to a server. On a locally run application, you can read and write the xml to wherever you want, for example to Application.StartupPath & "\myxmlDB.xml on the local harddrive., which is typically the folder the executable exists in(yourProject\bin)
Do you have any experience with .NET yet? Can you be more specific on what you need/where is your weakness? I'm afraid if I post a full .NET example of creating and using a local dataset, reading and writing to a file, it's not going to be what you are after.
Can you show me what you've tried so far? do you have a Windows Forms project yet? are you using the Microsoft Application Blocks to easily get data from a SQL database if desired? Are you using something else for connecting to a database?
Lowell
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply