public RolesProperties[] getDAta(RolesProperties OP) { string sqlstring = ""; sqlstring = "select Id,user_role,details"; sqlstring += "where 1=1"; if (OP.ID != "") { sqlstring += "and Id=" + SqlFunctions.qt(OP.ID); } if (OP.USER_ROLE != "") { sqlstring += "and user_role" + SqlFunctions.qt(OP.USER_ROLE); } if (OP.ROLE_DETAILS != "") { sqlstring += "and details" + SqlFunctions.qt(OP.ROLE_DETAILS); } RolesProperties[] omain; SqlDataReader drx; dbDataReader dr = new dbDataReader(); dr.ConnectionName = "ConnectionString"; dr.SqlString = sqlstring; drx = dr.GetData(); int cnt = 0; if (drx != null) { if (drx.HasRows) { while (drx.Read()) { RolesProperties oTmp = new RolesProperties(); oTmp.ID = (string)SqlFunctions.Nz(drx["Id"], ""); oTmp.USER_ROLE = (string)SqlFunctions.Nz(drx["user_role"], ""); oTmp.ROLE_DETAILS = (string)SqlFunctions.Nz(drx["details"], ""); //Array.Resize(ref omain, cnt + 1); //omain[cnt] = oTmp; //cnt += 1; //if (omain != null) // Array.Copy(omain, temp, Math.Min(omain.Length, temp.Length)); //omain = temp; } } drx.Close(); drx = null; dr = null; } return omain; }
List<RolesProperties>
ToArray()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)