public M_Authors GetAllAuthorDetail(int authorid) { DataTable dt = new DataTable(); Execute Exec = new Execute(DatabaseType.DBType1); dt = Exec.ExecuteQuery <DataTable>("SELECT * FROM Author WHERE AuthorId = " + authorid, 0, CommandType.Text); M_Authors A = new M_Authors(dt.Rows[0]); return(A); }
public List <M_Authors> GetAllAuthors(int top) { List <M_Authors> lst = new List <M_Authors>(); DataTable dt = new DataTable(); Execute Exec = new Execute(DatabaseType.DBType1); dt = Exec.ExecuteQuery <DataTable>("SELECT TOP " + top + " * FROM Author ORDER BY Name", 0, CommandType.Text); foreach (DataRow dr in dt.Rows) { M_Authors A = new M_Authors(dr); lst.Add(A); } return(lst); }