Returning a single row

前端 未结 10 2322
野的像风
野的像风 2021-02-13 06:58

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:41

    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.

提交回复
热议问题