Command problem

Peter_1985 2,526 Reputation points
2022-05-31T05:18:53.857+00:00

Hi,
I see that UserID0.Value is with the proper value 18 and there is the existing record with INT column user_id having the value 18. But it is not getting the record by the following command. Why?

            SqlCommand cmd = new SqlCommand("SELECT top 1 ... FROM [user_master] where [user_id]=@par_id", conn);

            if (UserID0.Value != null)
            {
                cmd.Parameters.Add("@par_id", SqlDbType.Int).Value = Convert.ToInt32(UserID0.Value);
            }
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,395 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,272 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,277 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,125 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Peter_1985 2,526 Reputation points
    2022-05-31T09:21:34.88+00:00

    I hover the mouse on t below, and do not see the same effect like you.

    206966-image.png


  2. bet365samcom 1 Reputation point
    2022-06-02T17:12:39.967+00:00

    thanks a lot!

    0 comments No comments