两个方法用的查询语句是一模一样的,有没有什么办法整理一下,就写一遍,用的时候调用.

两个方法用的查询语句是一模一样的,有没有什么办法整理一下,就写一遍,用的时候调用.

string sql_restep = "SELECT RefuseStep from flow where id='" + id1 + "'";
DataTable dt_restep = DataAccess.RunSQLReturnDT(sql_restep);

谢谢


       public DataTable GetData(string id)
        {
            string sql_restep = "SELECT RefuseStep from flow where id='" + id + "'";
            DataTable dt_restep = DataAccess.RunSQLReturnDT(sql_restep);
            return dt_restep;
        }

你把这两行代码放到一个方法里公开出来不就好了,都能用了