Click here to Skip to main content
15,891,865 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi This is my Code ,I Want to get thase Error How can fixed it.

What I have tried:

C#
 sqlcmd = new SqlCommand("SP_Name", conn);
 conn.Open();
 sqltrans = conn.BeginTransaction();
 sqlcmd.Transaction = sqltrans;
 sqlcmd.CommandType = CommandType.StoredProcedure;


 sqlcmd.Parameters.Add(new SqlParameter("@UserId", SqlDbType.Int, 4, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, UserId));



 sqlcmd.Parameters.Add(new SqlParameter("@Typ_Table", dt));

string Result = sqlcmd.ExecuteScalar().ToString();
Posted
Updated 5-Sep-17 21:18pm
Comments
Karthik_Mahalingam 13-Oct-16 1:07am    
make sure your sp has the parameter @Typ_Table
Suvendu Shekhar Giri 13-Oct-16 1:16am    
My Virtual 5!
Karthik_Mahalingam 13-Oct-16 1:43am    
:)
Message is perfectly clear. ;)
Suvendu Shekhar Giri 13-Oct-16 1:16am    
Share the relevant portion of your stored procedure and before that make sure your stored proc has a paramter named @Typ_Table.

Please check empty space in parameter at stored procedure and in sqlparameter

ex "@typ_table " contains empty space at end please remove this and check it
 
Share this answer
 
My guess is that the specified stored procedure doesn't have a parameter named "@typ_table". Did you misspell the parameter name?
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900