I have managed to put a listbox in my listview and have gotten the box to appear but it is empty. I want to click on the Edit link and based on the datakeyname value pass the parameter to the objectdatasourc e to fill the listbox. I'm trying to use IEnumerable and am not getting it. Can someone help with an understandable example. Or another way to do it.
I'm at a loss to what I am to return (see ??? ) and it doesn't like my (SqlInt32 PersonnelNumber ) telling me it can't convert to "SqlInt32? (in my EmployeeObject) " -
I'm at a loss to what I am to return (see ??? ) and it doesn't like my (SqlInt32 PersonnelNumber ) telling me it can't convert to "SqlInt32? (in my EmployeeObject) " -
Code:
public IEnumerable<AuthorizationObjectClass> GetEmployeeNoAuthorizations(SqlInt32 PersonnelNumber) { DataSet ds; AuthorizationObjectClass auth = new AuthorizationObjectClass(); try { //EmployeeObjectClass Emp = new EmployeeObjectClass(); Emp.PersonnelNumber = PersonnelNumber; ds = data.GetNotSelectedAuthorizations(Emp); if (ds.Tables.Count > 0) { auth.AuthorizationID = Convert.ToInt32(ds.Tables[0].Rows[0]["AuthorizationID"]); auth.AuthorizationDefinition = Convert.ToString(ds.Tables[0].Rows[0]["AuthorizationDescription"]); } } catch (Exception e) { Console.WriteLine("{0} Exception caught.", e); } return ???? ; }
Comment