wat is the best way to pass xml into Stored Procedure

Hi All,

I want to use XML technologies with SQL Server 2000 for sending master
details data from Application to SQL Server. I'm using xmldocument class for
writing data in the form of attribute centric elements. First I write data
into xmldocument (using appendchild, setattributes methods), and then I use
outerxml property to get the xml in a string variable to pass it to stored
procedure as input parameter, where I use openxml to insert this data into
corresponding tables. But I face problem after writing xmldocument in C#
(but not in VB.NET). When I see the value of string variable in Command
Window it contains attributes attached with / before quotes (") like
<Customer ID=/"ALFKI/" City =/"NY/" />
What can be done to solve this problem?
I also want to know from experienced programmers that, is this the best way
to use XML for sending data to Database ? What way should I choose, if this
is not the best way?


swadev (1)
3/24/2006 5:13:05 AM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 9

Can you post some sample code? Its hard to understand how exactly you
load the XML into the SQL db.

fundamol (4)
3/31/2006 6:37:34 PM
Hi Swat,

This is obviously an issue concerning familiarity with C#. I'm not that
experienced, but I think that what you're doing is the right way.

>> What can be done to solve this problem?

Firstly, are you sure that the string you see in the command window is

<Customer ID=/"ALFKI/" City =/"NY/" />

and not :

<Customer ID=\"ALFKI\" City =\"NY\" />  //Note the difference is
back-slashes and forward-slashes.

I believe it would be the latter case, since the backslash is what C#
uses to escape double quotes and other special characters within

Now we can move on to the implication of those back-slashes on your
stored procedure. The answer is that there is no implication, and if
your coding is done right, those back-slashes won't cause any problem.

If you don't believe me, just try executing this line : (Debug mode)
Console.WriteLine("<Customer ID=\"ALFKI\" City =\"NY\" />");

The output (might) surprise you. The compiler treats it that way, but
doesn't necessarily output it that way too.



zorg007 (48)
3/31/2006 10:08:25 PM

Similar Artilces:

best method
I am working on a spreadsheet that I use to figure an inventory results. I need to email only part of the information. I have thought of two methods to acheive my result. One is create a macro that would delete the un-needed worsheets and save the file to a new name. My other idea was to just create a macro that would just hide the un-needed and show the sheets that our accounting department needs for their records. Any suggestions on how to best get this done Hi Tim I would just copy the sheet you want to another file. Right click on Sheet tab>Move or Copy>Dropdown Move to se...

convert a custom config file to XML
Hi, I need to convert a home made config file to an XML one. My config file looks like this (it's an app that display some text in function of time): //config.cif BEGIN_241104 06:00-08:29;1;AAAA;BBBBB 09:00-12:29;1;CCCCC;DDDD END I don't know how to do it, maybe something like this but don't know if it's possible to do this: <Date = "241104"> <Hour>06:00-08:29</Hour> <Flag>1</Flag> <Label1>AAAA</Label1> <Label2>BBBBB</Label2> <Hour>09:00-12:29</Hour> <Lab...

Store Operations User's Guide Missing Pages
I'm new to this software and am using Version 2.0. My Store Operation's User's Guide (brand new - out of the box) is missing pages 273-284. How do I obtain a replacement manual? -- Todd Wilson ERC Communications ...

What is themeManager.xml?
It appears that Excel 2007 adds a reference to something called themeManager.xml when you save the files in the 2003 compatibility mode (i.e. .xls). Does anyone know what themeManager.xml does? saqib http://doctrina.wordpress.com/ ...

reading an xml file by fragments
I have an Xml document containing the serialization of a very big arraylist. Each Item having any type. The file is big and I don't want to load it like this but by fragment of item. I made a try with XPathNavigator, but the Value property does not send me the result on the form of an Xml string. So I cant deserialized it with XmlSerializer. Is there a way to do this? thank you ...

Best Practices
I have an Exchange 2000 server. I would like all my users to use the mailboxes from the store themselves not from .PSTs. What does everybody else do? What are the limits for an exchange server? How will my exchang server act if I leave all the mail on the mailboxes and not .PSTs? This is the ideal way to manage Exchange Server Storage and delivers the best user experience to employees. Exchange Server Standard Edition has a maximum storage size of 16GB, so when you reach that limit you either need to start archiving old emails to PST storage or upgrade to Enterprise edition, which is onl...

The easiest way to get free cash!
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft DHTML Editing Control"> <TITLE></TITLE> </HEAD> <BODY> <P>Hi all,</P> <P>I became a member of an interesting free website that is totally unique. It actually rewards its members for learning! You can learn lots of important things and earn rewards taking fun quizzes, plus earn cash for other activities! Membership is free, and people of all ages and educational backgrounds everywhere can become members and participate at their own level. It�s called �It P...

Is there a way to make a global change to multiple Customers?
This is a multi-part message in MIME format. ------=_NextPart_000_000F_01C9E446.DDB8A8C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello Every one, I have about 160 Customers in list ONE and then about 200 Customers in = list TWO and I wish to make a change in the payment terms from net 30 to = Pre-payment. I can pull the dat using smart List, but wonder if there a = tool or trick to populate/make the change once for all instead of going = into each individual customer account using CARDS? Or if I export the list from smart list t...

Best Hardware
If you were to design a machine from scratch and the primary goal was that Excel could fly, what would the machine's specs be? Multi-vs-single processor? Gigabytes of RAM? Faster spinning HD's? What do you think? "Ricardo Duran" <Ricardo.Duran@certance.com> wrote... >If you were to design a machine from scratch and the primary goal was >that Excel could fly, what would the machine's specs be? > >Multi-vs-single processor? Excel itself doesn't use multiple processors, so unless you have some OS that could give systems services processing to one pr...

ORACLE- SQL interface using XML
Hello: I have a .net web application , that uses aspx.net and vb.net pointing to a SQL database. I need to send and receive data from oracle/Sql, so I am supposed to use XML. I haven't used it before and I have no idea how to do it, so I am looking for a step by step guide or samples about how to do it. I will appreciate any help Thanks ...

Can't see mailboxes in System Manager
Last week, our Exchange Server crashed and a technician came in and did an Exchange Database repair. Today, I went to add a new user. When prompted if I wanted to add a mailbox, I did, but there was no Mailbox Store to choose from. I went to Exchange System Manager and under the First Storage group, I don't see our mailboxes where I used to. Can you tell me how to fix these problems? Thanks, Sandy M Is this true if you run ESM from a different machine? Nue "Sandy M" <SandyM@discussions.microsoft.com> wrote in message news:E74ABE4B-BEE5-41E0-A1A6-50E0240A3BA6@micros...

Debit Card Processing: Any Store in the LA area
I am setting up a store in the LA area with debit card processing using the RMS interface and would like to take a look at a store that is already setup in this configuration. If anybody has this configuration, are in the LA area and is willing to allow me to come to their store and visually inspect how they have setup their debit card processing. (ie. physical connection to computer, physical placement of machine, hardware used) Please reply to the newsgroup. Final note, if there are any Grocery Stores that are using this configuration that would be best, but any type of store is well appre...

im new to this so i under stand wat u r saying so hereis a tip dleat re start "jadawatts" <freemen@microsoft> wrote in message news:ezWbmSQALHA.5808@TK2MSFTNGP02.phx.gbl... > im new to this so i under stand wat u r saying so hereis a tip dleat re > start Vampirefo Spell Check. http://www.majorgeeks.com/download.php?det=2952 -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA jadawatts wrote: > im new to this so i under stand wat u r saying so hereis a tip dleat re > start Did your parents give you p...

Vlookups yielding wrong N/A results (numbers stored as texts and viceversa)
Hi there, my problem is that I have to do a number of vlookups (exact matches) on customer codes (which are numeric values). Most of the times, Excel returns an N/A error, even when it shouldn't, because the code is in both tables. My understanding is that this happens when Excel treats the code in the first table as a number, and the one in the second table as a text. How do I solve this extremely annoying problem? Since Excel is a spreadsheet and not a database, it allows you to choose a formatting, but not to set a data type for a field. So how do I make sure Excel treats the custome...

NetApp v3140 and Transaction Log placement Best Pratice
Given the unique nature of how NetApps manage the data in their SAN arrays, what is the recommended Best Practices for Transaction Log placement in this scenario? The old school says to place the Transaction Logs on separate disks, preferably Raid1. But, in this big pool of disks where writes happen all over the place, I argued with the tech guys referencing this way of thinking but the original placement of the logs still ended up on the same big set of disks as the datafiles... I am forcing them to change the log file placement for safety reasons but they are planning on s...

wats up
hi dad ...

Xml space and ms-data interpretation different in VS2005
I have a problem converting a program from Vb.net VS2003 to VS2005. I process a xml-file with an inline schema. In 2003 no problem. In 2005 I have 2 problems: 1) BIG space="preserve" problem. Suddenly the spaces are a problem during processing (The following text is not allowed in this context: ' '). Without the space="preserve" (or default) it works okay, but what to do now since I can't influence the dataformat. 2) SMALLER xml-msdata/IsDataSet problem. As long as there is a reference to the xml-msdata namespace in the file the VS2005 designers can't cor...

Post Exch 5.5 SP4 hotfixes for Information Store
I occasionally get the following error in my Exch 5.5 SP4 event log and have researched in on the MS site as well as other sites. I have been unable to find the Post-Exch 5.5 SP4 Information Store Roll-up fixes that are mentioned in the link below. Does anyone know where I can obtain these fixes? If you could drop me the link or any info, that would be much appreciated. Event Type: Information Event Source: MSExchangeIS Private Event Category: Transport Delivering Event ID: 2025 Description: The delivery of a message failed due to error 0000050A. A non-delivery report is being sent to ...

basic xml
Hello! I'm reading a book and I'm trying to learn the very basic about xml. Can somebody give me an explanation why namespace are used in xml perhaps with a simple example that demonstate the usefulness. //Tony Tony Johansson wrote: > Can somebody give me an explanation why namespace are used in xml > perhaps with a simple example that demonstate the usefulness. If there were no namespaces then you could not mix different XML vocabularies as you could not distinguish for instance the XHTML 'table' elment from a 'table' element in another vocabulary. Usin...

Convert time stored as decimalised number to time format
Hello How can I convert 3.5 hours to 3:30:00? -- Emma Emma A1/24 and formate as time Mike Rogers "Emma" wrote: > Hello > How can I convert 3.5 hours to 3:30:00? > -- > Emma ...

Best conversion tool?
I recently inherited a legacy Microsoft Access application. Most of the time I write C# web apps, but rewriting this app from scratch would be a lot of work. The Access app has over 80 forms and 50 reports. I doubt that any tool can completely convert from Access to ASP.Net, but if there is an 80-90% solution it would really help. I've googled the issue but I haven't found anything that looks very promising. If anyone knows of a quality conversion tool I would really appreciate it. P.S. Sorry about the crosspost, but as this post suggests I'm incredibly lazy. "Ready4Footba...

IS there a simple wat to create a query form
I would love my users (11 to 17 year olds) to be presented with a form containing a field where they can request a Merit Badge and have the form look up all valid counselors for that merit badge. The archetecture is in place to do this with a merit badge list for them to choose from and a list of counselors with links to their information (name, phone, etc.) I just can't seem to get it to work! Any ideas?? -- Dick Patton Boy Scout Troop 403 On Sun, 4 Apr 2010 13:45:01 -0700, Dick Patton <DickPatton@discussions.microsoft.com> wrote: >I would love my users ...

Import XML to Access ...
Hi, Under the structure of XML file. In a given file can be 1000 <MIX> ...</ MIX> in any <MIX> may be the a few to several <ingredient>. From the standpoint of the database would be to import the data into two tables 1. tblMix 2. tblIngredient (additional tables should be joined together one to many -- so that the data are connected to each other) Theoretically, it seems about to learn - but I sit a little longer (looking in the internet) .. and I can not prevail on this. Does anyone of you przerabia� import of XML to an Access VBA! ? how to deal w...

the incoming tabular data stream remote procedure call is incorrec
Hello, I am using SQL Server 2008 Express with sql native client 10.0 as a backend to an Access frontend. When I try to updated one of the linked tables in Access, I receive a server side error message stating "The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 6 (" "): Data type 0xE7 has an invalid data length or metadata length. I found some documentation on microsofts website which states that this issue was addressed in the cumulative update package 3 for sql server 2008 service pack 1 971491. ...

is there a way to make the bars on a bar chart narrower?
help anyone? -- mcarrington ------------------------------------------------------------------------ mcarrington's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=21641 View this thread: http://www.excelforum.com/showthread.php?threadid=498513 Hi mcarrington, Have you tried right clicking a bar then Format Data Series then change the Gap width? Ken Johnson Hi mcarrington, sorry, I left out one step... Right click a bar>Format Data Series>Options>change Gap Width. Ken Johnson ...