我做个了物品借用管理
在本地运行了 一切顺利 但是我发布在IIS上
在局域网上运行的时候就不行了 SqlDataReader 运行一半的时候就开始取不到值了
我去数据库里面看 活动链接有101个高手救救我啊 实在弄不定了 怎么才可以解决的我关闭数据库链接做得很好了 这是我所有的分了 真的 帮帮我

解决方案 »

  1.   

    我是用SqlDataReader 取值的 运行前一段时间还可以
    但当数据 连接有了101的时候 就取不到值了
    哪个大哥帮忙 加我qq276912755 通宵等啊 帮我这一次
    下次攒足了 200 送你 谢谢啊
      

  2.   


    public SqlDataReader ExecuteReader(string sql, ......)
    {
        ......
        SqlConnection connection = new SqlConnection(connectionString);
        SqlCommand command = new SqlCommand(sql, connection);    return command.ExecuteReader(CommandBehavior.CloseConnection);  // <-- 关闭 SqlDataReader 时,同时关闭关联的 SqlConnection
    }public void ReadDate()
    {
        ......
        SqlDataReader reader = ExecuteReader(sql, ......);
        while (reader.Read())
        {
            ......
        }
        reader.Close();  // <-- 关闭 SqlDataReader
    }