public static UserInfo GetUserById(int userId) { int retValue = -1; UserInfo user = new UserInfo(); //Generated Code for query : dbo.GetAllVendors using (SqlDataReader dr = ProjManagementAdmin.GetUserById(userId, out retValue)) //Initialize and retrieve code for Datareader goes here { while (dr.Read()) { user.UserName = dr["user_name"].ToString(); user.UserId = Convert.ToInt32(dr["user_id"]); user.UserEmail = dr["user_email"].ToString(); user.ChangedByName = dr["changed_by"].ToString(); } //dr.Close(); } return(user); }