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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:35:57+00:00 2026-06-01T14:35:57+00:00

I am passing a datatable from Code to stored procedure in this way. DataTable

  • 0

I am passing a datatable from Code to stored procedure in this way.

DataTable table = CommonFunctions.ToDataTable(request);
object[] spParams = new object[1];
spParams[0] = table;

DbCommand dbCommand = 
  db.GetStoredProcCommand("OS_UpdateOrgStructureDetails", spParams);

I am trying to access this parameter in stored proc.

CratePROCEDURE OS_UpdateOrgUnits  
 @table OS_RenameNodeTable READONLY  
AS  
BEGIN  
    UPDATE OrgUnit  
    SET DetailName = ut.NewValue  
    FROM @table ut  
    INNER JOIN OrgUnit ou ON ou.OrgUnitID = ut.OrgUnitID  
END 

But when the call is made to stored procedure it throws an error.

The incoming tabular data stream (TDS) remote procedure call (RPC) protocol 
stream is incorrect. Table-valued parameter 1 ("@table"), row 0, column 0: 
Data type 0xF3 (user-defined table type) has a non-zero length database name 
specified.  Database name is not allowed with a table-valued parameter, only 
schema name and type name are valid.

Not able to resolve the error.

  • 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-06-01T14:35:57+00:00Added an answer on June 1, 2026 at 2:35 pm

    Because of a bug in the SqlCommandBuilder.DeriveParameters method, the TypeName property of the SqlParameter object for the table valued parameter contains the database name (see http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommandbuilder.deriveparameters.aspx, the comment “Table valued parameters not typed correctly”).

    The fix this you can add this general purpose code right after creating the command:

    foreach (SqlParameter parameter in dbCommand.Parameters)
    {
        if (parameter.SqlDbType != SqlDbType.Structured)
        {
            continue;
        }
        string name = parameter.TypeName;
        int index = name.IndexOf(".");
        if (index == -1)
        {
            continue;
        }
        name = name.Substring(index + 1);
        if (name.Contains("."))
        {
            parameter.TypeName = name;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am passing an object from richface datatable like: <rich:column> <a4j:commandLink value=Transfer inside Group
Below is a code snippet for passing a table as a parameter to a
I am looking for a way to import a datatable from Access into an
I am facing this problem. I have a stored procedure which returns 6 rows
I have C# application that fills a GridView with data from a DataTable object,
I'd like to define a class which is derived from System.Data.DataTable. This class has
warning: passing argument 1 of 'bsearch' makes pointer from integer without a cast and
I'm passing raw HTTP requests to an apache server (received by PHP). The request
If I am passing an object to a method, why should I use the
How to the select top n rows from a datatable/dataview in ASP.NET? Currently I

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.