Code not working RRS feed

  • Question

  • User-797751191 posted


      I have below statement , i want to concatenate 2 columns & also check for Null Value

    using (SqlCommand cmd = new SqlCommand("SELECT CONCAT(IsNull([Name],''), ' ', IsNull([Name 2],'')) as Name,CONCAT(IsNull([Address],''), ' ', IsNull([Address 2],''), ' - ',IsNull([City],'')) as Address FROM [Customer] Where [No_]=@Cu", con))


    Sunday, June 23, 2019 4:59 PM


  • User288213138 posted

    Hi jsshivalik,

    I tested your query statement and found no problem. The reason why your code doesn't work should be "Where [No_]= @cu", so please check if there is something wrong with your “@cu” value.

    The table and result:

    Best Regard,

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 24, 2019 6:14 AM