C#如何让多个表的查询在同一个方法里完成?代码如下

    public List<UserInfo> ExecuteReaderBySQL(string queryString, UserInfo user, List<object> objlist)
    {
        List<UserInfo> thisobj = new List<UserInfo>();
        SqlCommand sqlCommand = new SqlCommand(queryString, conn);
        open();
        try
        {
            SqlDataReader dr = sqlCommand.ExecuteReader();
            while (dr.Read())
            {
                user = new UserInfo();
                user.loginName = (string)dr["u_loginname"];
                user.pwd = (string)dr["u_pwd"];
                thisobj.Add(user);
            }
        }
        catch (Exception ex)
        {
            throw new NotSupportedException(ex.Message);
        }
        finally
        {
            close();
        }
        return thisobj;
    }
查看全部
a772680400
a772680400
2015/07/24 07:12
  • c#
  • 点赞
  • 收藏
  • 回答
    私信

5个回复