ADO.NET - The Size property has an invalid size of 0

前端 未结 10 1005
小蘑菇
小蘑菇 2020-12-14 13:41

I\'m trying to get output value from DB via ADO.NET. There\'s a client code:

    using (var connection = new SqlConnection(ConnectionString))
    {
                


        
10条回答
  •  抹茶落季
    2020-12-14 14:41

    VarChar and NVarChar are variable width character fields (thus var+char). You have to set the length, otherwise the default is zero.

提交回复
热议问题