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

Related Questions

I have a stored procedure which accepts a User defined table type called SeasonTable
I have a user defined function which is used in many stored procedures which
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
I'm using an istream which could be stringstream, ifstream or a user-defined stream type
So I have this user-defined table type parameter, which is used in my scalar
I have a parser method which will fill a user defined collection type upon
Suppose I have a user defined type: CREATE OR REPLACE TYPE TEST_TYPE AS OBJECT
I have a user-defined table type. I want to check it's existence before editing
I have a script which creates a user-defined object like this: obj = new

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.