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

前端 未结 10 1000
小蘑菇
小蘑菇 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:44

    Incidentally, setting the size property of an output parameter is necessary even if it isn't a string-type parameter. For example, if you are using a System.Data.SqlDbType.Int, you should set the size to be 4.

提交回复
热议问题