Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 384667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:24:10+00:00 2026-05-12T15:24:10+00:00

Guys lease help me out I think I’m close, but I’m missing something. Background

  • 0

Guys lease help me out I think I’m close, but I’m missing something.

Background

I’m rewriting a SQL CLR assembly (stored procedure), my assembly contacts another resource and gets back XML. I want to return this XML as a recordset, NOT a scalar value.

From what I’ve seen, this is how to return a recordset:

SqlContext.Pipe.Send(mySqlDataReader)

The Send method takes in 3 possible parameters:

public void Send(string message);
public void Send(SqlDataRecord record);
public void Send(SqlDataReader reader);

The SqlDataReader class does not have a constructor, how does SqlCommand.ExecuteReader() return one?

What I think I need to do

  • Create my own class inheriting from
    IDataReader.
  • Make this class consume the XML, and expose it as
    records (like a DataReader).
  • Override SqlDataReader and pass this to SqlContext.Pipe.Send(mySqlDataReader)
    ???

This is where it gets fuzzy.

How do I return my custom recordset back to SQL Server?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:24:11+00:00Added an answer on May 12, 2026 at 3:24 pm

    I guess you’d better use SqlDataRecord. You can see a description here

    It should look like follows:

     SqlDataRecord record = new SqlDataRecord(new SqlMetaData[] { new SqlMetaData("Column1", SqlDbType.NVarChar)});
    
     // Set the record fields.
     record.SetString(0, youVariableWithXmlData);
    
     // Send the data
     SqlContext.Pipe.Send(record);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey Guys. I need help understanding my hw assignment. I am starting out in
guys am having some troubles with running out of memory when displaying an animation
Guys, I am using SQL Server 2000 and executing the sp_columns stored procedure to
Trying not to repeat myself (to be DRY) here, help me out. =) I
Hello guys can you please help me with this problem. When a simple image
I am working on an iPad application and need some help from you guys.
Hey guys i'm making a website but for some reason my div tags are
Hey guys, sorry I'm kind of new to programming, but I had a small
Hi guys I was wondering if anyone could help me with the following: I
I was wondering if you guys could help with a complicated query. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.