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 828267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:41:58+00:00 2026-05-15T03:41:58+00:00

I have a user defined type, which is a datatable in an SqlServer database.

  • 0

I have a user defined type, which is a datatable in an SqlServer database. I have been using Database, DbCommand, etc to call stored procedures and get a Dataset back. Datasets are handy in that they can contain multiple tables.

Now I want to pass a Datatable in, so I tried:

string _strComText = "stored_procedure_name_changed_to_protect_the_innocent";
_objCom = _objDB.GetSqlStringCommand(_strComText);
_objDB.AddInParameter(_objCom, "@BASE_ITEMIDS", DbType.Object, dtItemIds);
_objCom.CommandType = CommandType.StoredProcedure;
dataset = _objDB.ExecuteDataSet(_objCom);

But I get an exception that “@BASE_ITEMIDS” is not the correct type:
“The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 1 (\”@BASE_ITEMIDS\”): Data type 0x62 (sql_variant) has an invalid type for type-specific metadata.”

I’ve seen this done with SqlReader, but can sqlReader be used to get back multiple tables? If my first table is empty, I don’t see any rows in SqlReader.

  • 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-15T03:41:58+00:00Added an answer on May 15, 2026 at 3:41 am

    can sqlReader be used to get back multiple tables?

    Yes. You have to read each table in sequence and call the .NextResult() method between tables.

    using (var rdr = MySqlCommand.ExecuteReader())
    {
        do 
        {
           while (rdr.Read())
           {
               //do something with each record
           }
        } while(rdr.NextResult());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 514k
  • Answers 514k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You will end up on Rails 3 eventually. In my… May 16, 2026 at 6:22 pm
  • Editorial Team
    Editorial Team added an answer You can leave out the square root because for all… May 16, 2026 at 6:22 pm
  • Editorial Team
    Editorial Team added an answer div.top div.bottombar div.largebutton:hover { background-color: #9999FF; } I think it's… May 16, 2026 at 6:22 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a complex data structure (user-defined type) on which a large number of
Basically I have a User-Defined Table Type (for use as a table-valued variable) which
Is there a way to declare a variable with a particular user-defined type in
I have a class Wizard which creates a wizard with pages defined in the
I have a theme in which there are numerous options, like:- Setting Theme Type
Why is it that for user defined types when creating an array of objects
I have 2 databases with a 2 tables with HierachyID fields. For one database
I have some trouble for choosing the right type of exception to throw when
I'm creating a Settings object in my app, used for storing user-defined settings and
I have a dropdown list containing the days of the week - Monday to

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.