How do you write a XML file to a SqlDatabase?

I'm working on a desktop application that writes data to a XML file, that 
part is working. Now I need to insert that data to a sql database. I have no 
idea were to start. Two questions, how do you do that, and is there an good 
toturial showing you how to do that?
0
Utf
2/11/2010 8:43:03 PM
dotnet.xml 7266 articles. 0 followers. Follow

4 Replies
1840 Views

Similar Articles

[PageSpeed] 0

hi,

On 11.02.2010 21:43, bthumber wrote:
> I'm working on a desktop application that writes data to a XML file, that
> part is working. Now I need to insert that data to a sql database. I have no
> idea were to start. Two questions, how do you do that, and is there an good
> toturial showing you how to do that?
What kind of XML file or data are we talking about? Maybe fragments? Are 
these files schema based? Do you need to query these data with T-SQL?

SQL Server has a data type XML for storing fragments:

   http://msdn.microsoft.com/en-us/library/ms189887.aspx
   http://msdn.microsoft.com/en-us/library/ms187339.aspx

It also has the FILESTREAM data type for storing files.

   http://msdn.microsoft.com/en-us/library/bb933993.aspx


mfG
--> stefan <--
0
Stefan
2/11/2010 9:00:16 PM
Hi Stefan,

The XML is a file.

"Stefan Hoffmann" wrote:

> hi,
> 
> On 11.02.2010 21:43, bthumber wrote:
> > I'm working on a desktop application that writes data to a XML file, that
> > part is working. Now I need to insert that data to a sql database. I have no
> > idea were to start. Two questions, how do you do that, and is there an good
> > toturial showing you how to do that?
> What kind of XML file or data are we talking about? Maybe fragments? Are 
> these files schema based? Do you need to query these data with T-SQL?
> 
> SQL Server has a data type XML for storing fragments:
> 
>    http://msdn.microsoft.com/en-us/library/ms189887.aspx
>    http://msdn.microsoft.com/en-us/library/ms187339.aspx
> 
> It also has the FILESTREAM data type for storing files.
> 
>    http://msdn.microsoft.com/en-us/library/bb933993.aspx
> 
> 
> mfG
> --> stefan <--
> .
> 
0
Utf
2/12/2010 1:08:01 PM
Stefan,

I review those links, they did not much in answering the question about how 
do you save an xml file to a sql database.

"Stefan Hoffmann" wrote:

> hi,
> 
> On 11.02.2010 21:43, bthumber wrote:
> > I'm working on a desktop application that writes data to a XML file, that
> > part is working. Now I need to insert that data to a sql database. I have no
> > idea were to start. Two questions, how do you do that, and is there an good
> > toturial showing you how to do that?
> What kind of XML file or data are we talking about? Maybe fragments? Are 
> these files schema based? Do you need to query these data with T-SQL?
> 
> SQL Server has a data type XML for storing fragments:
> 
>    http://msdn.microsoft.com/en-us/library/ms189887.aspx
>    http://msdn.microsoft.com/en-us/library/ms187339.aspx
> 
> It also has the FILESTREAM data type for storing files.
> 
>    http://msdn.microsoft.com/en-us/library/bb933993.aspx
> 
> 
> mfG
> --> stefan <--
> .
> 
0
Utf
2/12/2010 1:31:03 PM
hi,

On 12.02.2010 14:31, bthumber wrote:
> I review those links, they did not much in answering the question about how
> do you save an xml file to a sql database.
As you did not give us a concrete question with a concise and complete 
example, how could we know what you are doing?

Also you haven't read 'em carefully engouh. What about 'Working with the 
XML Data Type in Applications' or 'Managing FILESTREAM Data by Using 
Win32'? They provide nice C# examples.


mfG
--> stefan <--
0
Stefan
2/13/2010 9:49:57 AM
Reply:

Similar Artilces:

Comparing-Merging Two Files
Is there any way to take 2 similar files and find what changes you have added to one and combine it with the original? denny, Just saving the new file using the old file's name will do that. Or are you talking about file sharing, where more than one person can work on the workbook at the same time? Henry "denny" <denny@discussions.microsoft.com> wrote in message news:11A8050C-2565-4AF2-BDA3-971D91FC013D@microsoft.com... > Is there any way to take 2 similar files and find what changes you have > added > to one and combine it with the original? "H...

Importing XML into Excel #2
I am trying to download this (http://www.bodog.com/sports- betting/mlb-baseball.jsp) page in Excel 2003, but get an "invalid xml declaration" error. Anyone know the problem? ...

Using C# to conver XML into Excel ?
Hi Experts: Anyone knows if C# provide functions to convert XML file into Excel format? Thanks Polaris Hello! > Anyone knows if C# provide functions to convert XML file into Excel format? Do you mean the Excel XML format or the "old" Excel binary format? The first one should be easy to create with XSLT (see System.Xml.Xsl) the second with Office-Interop or special third-party libs. -- Pascal Schmitt ...

Money stops responding while compressing backup file
Until last week, Money 2003 behaved as configured: it compressed my backup file before writing it to my backup floppy drive (which is actually a zip disk). For no known reason, it has started to hang up (that is, Windows XP Task Manager reports that it is not responding) right after it displays the progress bar for compressing the backup file. No progress occurs, and it never hits the zip drive. Any suggestions will be welcome. I didn't find anything relevant when searching the newsgroup's archives. In microsoft.public.money, Larry wrote: >Until last week, Money 2003 beha...

Choosing File Details to Include
When syncing my device through WMP using WMA files all the file details (such as artist name, album name) were transfered with the file. However, when I tried to sync MP3 files the only info that transferred was the file (song) name - it also had included the the track# as part of the song name. Last night I THINK I came across a window where I could check off which details to include and also had the option to remove the track # from the song name. Today I cannot find that screen anywhere. Where would I have seen such a screen and how do I find it again? Thanks -- ...

Importing old .pst files into Outlook/Outlook Express
I backed up my .pst files and had my computer wiped clean, reinstalled Windows XP and Office XP. How do I import the old .pst files into Outlook Express and Outlook? The help file doesn't tell me how. On Wed, 5 May 2004 08:56:27 -0700, "S. Lyons" <anonymous@discussions.microsoft.com> wrote: >I backed up my .pst files and had my computer wiped clean, >reinstalled Windows XP and Office XP. How do I import the >old .pst files into Outlook Express and Outlook? The help >file doesn't tell me how. You can transfer your old .pst file(s) onto your hard ...

hyperlink to files on the network
I am looking for the best way to allow end users to create links to files on the network. I have a table that has a hyperlink field and I am using that field in a subform. What I would like is that when the field is empty and a user clicks in the field it allows then to choose the file they want to link to (I assume a dialog box would pop up). I know that the user can right click, choose hyerlink, then edit a hyperlink but that seems very inefficient and the user would have to be "trained" that they need to right click on the field to even know it was an option. Any help? ...

Dialog prompt during opening of file
Good day! Need help here, How can I make my dialog to be run during opening of file? -- markuss ------------------------------------------------------------------------ markuss's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=34966 View this thread: http://www.excelforum.com/showthread.php?threadid=553962 markuss, use a workbook open event, like this Private Sub Workbook_Open() MsgBox "You just opened this workbook" End Sub To put in this macro, from your workbook right-click the workbook's icon and pick View Code. This icon is to the left of ...

Recovered Files
Hello All, I recently noticed upon starting up my iBook that there is always trash in my bin that wasn't there when I shut down. With further inspection, it revealed that it was a "recovered files" folder from Office. This is a minor annoyance, but how could I get rid of it? Thanks, Mavreen ...

can i save an existing .xls file as a .csv file using command line
I have an .xls file that I want to convert to a .csv file using the command line. Is this possible? Try this: ActiveWorkbook.SaveAs Filename:= _ "C:\Documents and Settings\All Users\Desktop\Book1.csv", FileFormat:=xlCSV "craigkan" wrote: > I have an .xls file that I want to convert to a .csv file using the command > line. Is this possible? this code does not work from the command line. if i go to my excel directory i can run C:\Program Files\Microsoft Office\OFFICE11>excel.exe filename.xls which will open filename.xls, but i can't figure out h...

Can 2 users use the same Outlook XP .pst file??
Hi, My computer has 2 different user names. Is it possible for both users to use the same Outlook (XP) mail files? If so, does anyone know how? Thanks Different users can share the same pst file as long as they both have access to the file and they don't access the pst file at the same time. "Dave" <anonymous@discussions.microsoft.com> wrote in message news:002901c3cc29$c39da5c0$a001280a@phx.gbl... > Hi, > My computer has 2 different user names. Is it possible > for both users to use the same Outlook (XP) mail files? > If so, does anyone know how? > >...

Verify If Start Date Exists In Another Record Before Write
Hello all... I trying to do some validation of a record before it writes to be database. Here's the scenario: My table includes the following fields: contractID Autonumber Field contractContractor The Contractor's ID contractProjectNumber The Project Number contractStartDate The Start Date of the Project contractEndDate The End Date of the Project I have the entry done on a form with those fields. What I want to do is when the next record is entered, BEFORE the record is written to the database, check to see if the...

File->Save does not work
Hi! I deleted the items Save and SaveAs from menu File and put them in place again using ID_FILE_SAVE and ID_FILE_SAVE_AS but OnFileSave is not being called. Any suggestion? Thank you. Have you still got an entry for Save/Save As in the message map? Something along the lines of : ON_COMMAND(ID_FILE_SAVE, OnSave) "Cadu" wrote: > Hi! > > I deleted the items Save and SaveAs from menu File and put them in place > again using ID_FILE_SAVE and ID_FILE_SAVE_AS but OnFileSave is not being > called. Any suggestion? > > Thank you. > > > Thanks, Adria...

PDF file has different font
Publisher displays a special font and prints it just fine but when I "Publish as PDF" for the document, what should be the special font in the pdf file is a different font. Any suggestions? TIA, lorendi Are you using Acrobat? Not all fonts can be embedded. What version Publisher are you using? If you are using 2007 try the Office 2007 *save as PDF* add-in. https://www.microsoft.com/downloads/details.aspx?FamilyId=4D951911-3E7E-4AE6-B059-A2E79ED87041&displaylang=en -- Mary Sauer http://msauer.mvps.org/ "NoSpam" <lorendi@austin.net> wrote in message news:e...

Is it possible to format a PSObject with a .ps1xml file?
This might be a totally ridiculous question...but here goes anyway: I have a couple of filters in modules that write PSObjects to output using code like: $x = New-Object PSObject -Property @{ one = "one" two = "two" } Write-Output $x There's just way more properties. How does one specify 'default' formatting styles for a System.Management.Automation.PSCustomObject like you can with other types using .ps1xml files? That may not even be the right question to ask. What I'd like would be a way to define the default formatting for ...

XML as Ini file
Be gentle. I need the equivalent of an ini file or registry key in my program. Both are denigrated. So is using the app.config file to store run-time configuration values. Ok, fine. I'm thinking that the general solution (C#) is to read in the configuration file with XmlDocument and then navigate to the node of interest with XmlNavigator. Am I on the right path, so far? (More detailed questions later.) -- Rick Hi Rick, I have a C# helper class that lets me store options in an ini-file like structure but with XML. Maybe you can extract something for your special case. Here...

Outlook Suggest names file location
Is there any way to expose the entire file of Suggest Names? in Outlook 2002 on XP. I have discovered how to delete one at a time but I would like to edit the entire file? Is this possible? Linda Yep, locate the nk2 file of your profile and rename it to .old -- Roady [MVP] www.sparnaaij.net Microsoft Office and Microsoft Office related News Also Outlook FAQ, How To's, Downloads and more... Tips of the month: -Create your own fully customized Toolbar -Creating a Classic View in Outlook 2003 Subscribe to the newsletter to receive news and tips & tricks in your mailbox! www.spar...

Turning pages into files
Using Publisher 2003 - I am writing a hiking book of 100 hikes. I was advised in a self publishing class to use the Publisher program and to make each hike a "page". So I have done this and have a 105 page document. Each page has a picture, map and written paragraph or two of one of the 100 mhikes. Now I have been told I should have made each hike a separate folder so I can go in and work on each hike w/o opening all the pages and having to scroll through. I have also been told that each time I open this document, it denegrates the pictures over time with the constant opening...

How to associate attachment file types with a previewer?
....specifically the text file previewer. Working with a team of developers, people are often sending attachments with .cs or .sql extensions and it would be nice to be able to preview these as text. Is there some way to tell Outlook that these file types should be associated with the text previewer? Regards, -- TB In Control Panel=>Folder Options->File Types - select the file extensions you want to associate with the previewer (I use Notepad). You can also do this by selecting the attachment and download to the desktop, right click and select Open With and select your option ...

my file is too big. Which embedded element is to blame?
When trying to edit a large file with many pictures and embedded word, Excell file, How can I find out who is the major contributor to the size of the file? Assuming a Word 2007 file (docx), you could change the extension to zip and check out the different files in the zip package. Yves "PAR" <PAR@discussions.microsoft.com> wrote in message news:D097C823-309D-4E19-9858-AE8B9E0F2058@microsoft.com... > When trying to edit a large file with many pictures and embedded word, > Excell > file, How can I find out who is the major contributor to the size of th...

Opening File To Current Date Sheet
Hello, Using Excel XP. I have a workbook that contains the dates of the month as separate worksheets, e.g., Nov1, Nov2, Nov3 and so on to Nov30. How can I have Excel go to the current day's sheet when I open up the file. Thanx in advance, Michael One way: Put this in your ThisWorkbook code module (right-click on the workbook's title bar and choose View Code): Private Sub Workbook_Open() On Error Resume Next Sheets(Format(Date, "mmmdd")).Activate On Error GoTo 0 End Sub In article <2bxwb.51779$xV6.18800@lakeread04>, "Mike...

data exchange with XML
What is Microsoft solution for the data exchange between different platform with XML? Thanks. Hello! > What is Microsoft solution for the data exchange between different platform > with XML? Thanks. What do you mean? XML itself is considered the solution... You can, for example, export XML from Access, transform it using XSLT and import it into eXist. -- Pascal Schmitt What is eXist and what is it used for? Thanks. "Pascal Schmitt" <newsgroup@cebra.nu> wrote in message news:OOUiYvDyFHA.2312@TK2MSFTNGP14.phx.gbl... > Hello! > >> What is Micro...

Curreny data and Xml
I have the following error: SOAP Server Application Faulted <detail><error><code>80041a07</code><description>An invalid value was passed in for a field</description><details>The data for the attribute 'CFCvariable1' has contains invalid characters</details><file>D:\CRM\Core\src\platform\include\OMCommon\CrmPropertyBagUtil.inl</file><line>640</line></error></detail> Source: System.Web.Services. <salesorder><CFCvariable1>776,50</CFCvariable1></salesorder>. How I can add a c...

Browse file share and return file path as a hyperlink
Hello, I have a Text Box (Doc_Link#1) on a form, and when the user clicks on the Text Box it activates the code listed at the Website listed below (works great). The code activates the Browse feature of windows and allows you to browse for a file and open it. The issue is that instead of opening the file I want the code to copy the files path back into the Text Box, and make it a hyperlink. Does anyone know how to modify the code to make this happen? Again, I want to be able to click on the Text Box, Browse the file share, select a file, and have the code return the files path to the...

Strange behaviour reading XML into DataSet
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. I'm getting some strange results depending the input XML file I use. I was wondering if somebody could help me understand what is going on or point me to a good reference. The code for my program looks like this: using System; using System.Data; static void Main(string[] args) { DataSet ds = new DataSet(); ds.ReadXml("test.xml"); PrintDataSet(ds); } public static void...