473,395 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

xml to sql thru an object


Hello,

i need to parse an xml file and insert the values into mssql, i was thinking
of creating an object that will hold the values before inserting them and do
some validation on them when done parsing i loop thru that object and insert
them ..

anyone has some idea or code that can help please email me at marwan.ak@gmail.
com
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...sharp/200507/1
Nov 17 '05 #1
2 1143
Hi,

You dont need to parse XML outside of stored procedure.. Just send XML to
stored procedure (text param).. and use 'sp_xml_preparedocument' and
'OPENXML' for inserting xml data to table.

sample: http://www.topxml.com/sql/openxml_and_ado.asp

Regards,
Josip Habjan
URL: http://www.habjansoftware.com
"MAK via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in message
news:51***********@DotNetMonster.com...

Hello,

i need to parse an xml file and insert the values into mssql, i was
thinking
of creating an object that will hold the values before inserting them and
do
some validation on them when done parsing i loop thru that object and
insert
them ..

anyone has some idea or code that can help please email me at
marwan.ak@gmail.
com
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...sharp/200507/1

Nov 17 '05 #2
Josip Habjan wrote:
Hi,
You dont need to parse XML outside of stored procedure.. Just send XML to
stored procedure (text param).. and use 'sp_xml_preparedocument' and
'OPENXML' for inserting xml data to table.
i need to parse an xml file and insert the values into mssql, i was
thinking
of creating an object that will hold the values before inserting them and
do
some validation on them when done parsing i loop thru that object and
insert
them ..

anyone has some idea or code that can help please email me at


Personally I would stick to your original idea. Have an object that
parses the XML an to produce the values. Then have a separate object
that builds the SQL based on the values. That way your SQL building is
not coupled to the values coming from XML, they can come from anywhere.

Cheers
Jimbo
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Jakob Bieling | last post by:
Hi! I am using VC++ 7.1 and have a question about return value optimization. Consider the following code: #include <list> #include <string> struct test {
2
by: sparks | last post by:
I was going to loop thru the tables and change some properties. 10 <<<<<< prp.value --prp.name = Type False <<<<prp.value --prp.name = allow zero length 10 <<<<<< prp.value --prp.name = Type...
6
by: BBFrost | last post by:
I'm using Net 1.1 (2003) SP1 & Windows 2000 Here's the issue ... Rows 12 thru 24 are selected in a datagrid. The user now unselects rows 12 thru 24 and selects rows 45 thru 70 ??? How can...
2
by: | last post by:
I have a breakpoint in an aspx page that I'm using to try to trap some code to see what's going on. I'm translating a page that is working in a traditional ASP page, which takes several session...
2
by: Dean Slindee | last post by:
Is there any way to refer to the .text property of a status bar panel thru object syntax, like below (the inner "for" does not work): Public Function FormStatusBarPaint(ByVal frm As Form)...
7
by: Dan Sikorsky | last post by:
How do you iterate thru a dataset to change money fields to a different value? Here's what I have. My dataset is filled directly from a stored procedure. ' Create Instance of Connection and...
2
by: Thief_ | last post by:
I'm using the following code to cycle thru all combo items: Private Sub btEditFavMembers_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btEditFavMembers.Click Dim...
3
by: sloan | last post by:
How does one "pass thru" a Raised Event.... I am using the Adapter Pattern to sync up some different interfaces. http://www.dofactory.com/Patterns/PatternAdapter.aspx My Question is this:
7
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi I am trying to see if I can call a Library remotely. The library contains a Form that I want to display then pass back some data to user that called this form remotely. I have it working...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.