Returning a single row

前端 未结 10 1471
轻奢々
轻奢々 2021-02-13 06:55

I\'m trying to return a single row from a database:

using (connection = new SqlConnection(ConfigurationManager.AppSettings[\"connection\"]))
{
    using (command         


        
10条回答
  •  一个人的身影
    2021-02-13 07:45

    First of all you can use the cast (string)reader["col_1"]. You are probably expecting a string and reader["col_1"] is an object.

提交回复
热议问题