Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > Database & Database Programming

Database & Database Programming MySQL, Oracle, SQL, PL/SQL, ABAP, Smart Forms, and other databases and languages. A database is an organized body of related information used in many websites (including CC).

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-17-2007, 09:35 AM
hoser2001's Avatar   
hoser2001 hoser2001 is offline
Programmer
 
Join Date: Jul 2006
Posts: 175
Rep Power: 9
hoser2001 is on a distinguished road
Default Change method to send sql server sproc XML

In sql server 2000, to send an xml document to a stored procedure, I needed to use the following method:

Here is the C# .NET code to prepare the xml to be sent to sproc.
Code:
con.Open();
SqlCommand cmd = new SqlCommand("ScanResults", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@doc", SqlDbType.NText).Value = XMLReturn;
SqlDataAdapter adp = new SqlDataAdapter(cmd);
adp.Fill(dataset, "ID");
con.Close();
Here is the how the sproc handles this:
Code:
CREATE PROCEDURE [csTest].[ScanResults] (@doc ntext)

AS
DECLARE @iTree int
EXEC sp_xml_preparedocument @iTree OUTPUT, @doc

~buncha crap~

EXEC sp_xml_removedocument @iTree
	
RETURN
Now I am working with sql server 2005, and from what I understand it has the ability to send actualy xml document types to sprocs... I would like to know how to change the sproc and code snippet to use this new method. Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[C] Server doesn't send a message on mailslot Alhazred C and C++ 3 08-13-2007 05:48 AM
How do I centralize sql server database hoser2001 Database & Database Programming 3 07-13-2007 01:07 PM
Accessing Databases without SQL Server or FP Extensions ashleysmithd Database & Database Programming 2 07-10-2007 01:47 PM
Database Tuning Advisor in SQL Server 2005 reachpradeep Database & Database Programming 0 03-03-2007 12:46 PM
Installing SQL server on Windows XP 64 bit roger Database & Database Programming 1 05-23-2006 10:13 AM


All times are GMT -5. The time now is 02:48 AM.

Contest Stats

John ........ 223.00000
dargueta ........ 168.00000
Xav ........ 164.00000
LogicKills ........ 20.00000
gaylo565 ........ 18.00000
WingedPanther ........ 15.00000
|pH| ........ 15.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 67%

Ads