ListView Problems


Author
Message
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi All.

This should be dead simple - I have a BO called boAllPeople with a data access method called GetAllPeople():

public void GetAllPeople()

{

SqlCommand loCommand = new SqlCommand();

loCommand.CommandType = CommandType.StoredProcedure;

loCommand.CommandText = "prcListAllPeople";

this.FillDataTable(loCommand);

}

Here is the code in prcListAllPeople:

ALTER PROCEDURE [dbo].[prcListAllPeople]

AS

BEGIN TRY

DECLARE @RetVal INT

SET @RetVal = 1

SELECT first_nme, last_nme, contact_dtl, people_id

FROM dbo.vw_AllPeople

ORDER BY last_nme, First_nme

END TRY

BEGIN CATCH

/* Get the details of the error*/

EXEC prcLogError

SET @RetVal = -1

END CATCH

IF @RetVal < 0

BEGIN

DECLARE @ErrText VARCHAR(1000)

SET @ErrText = 'Unable to Retrieve People List'

RAISERROR( @ErrText, 16, 1 )

END

RETURN @RetVal

There are no records in my error_log table.

This is how my listview is configured

Columns collection has 3 columns: 1 for first name, last name and primary phone.

PopulationDataSource = boAllPeople.GetAllPeople()

Display fields are

{0} - last_nme

{1} - first_nme

{2} - contact_dtl

Tag is people_id

Columns are the same as what is in the columns collection and population type is formatted string.

PopulateOnFormLoad = FormLoad

I have verified that the view does have a record in it. However, when my form comes up, the list view contains the column headings in the first row where the single record in the view should be.

Can anyone tell me what I am doing wrong?

Thanks!

 


Reply
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi Charles.

At least this time something new happened. I got an error:

ArgumentException
  Object of type 'TGIF.BusinessObject.boAllPeople' cannot be converted to type 'System.Data.DataTable'.

Source     : mscorlib

Stack Trace:
   at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
   at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at MicroFour.StrataFrame.UI.Windows.Forms.ListView.GetFilledBusinessObject(Object[] Parameters)

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Marcia G Akins - 16 Years Ago
Charles R Hankey - 16 Years Ago
Marcia G Akins - 16 Years Ago
Marcia G Akins - 16 Years Ago
Charles R Hankey - 16 Years Ago
Marcia G Akins - 16 Years Ago
Marcia G Akins - 16 Years Ago
Marcia G Akins - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Marcia G Akins - 16 Years Ago
                         No problem. Glad it helped :)
Trent L. Taylor - 16 Years Ago
Marcia G Akins - 16 Years Ago
Marcia G Akins - 16 Years Ago
                         Inherited UI is for DevExpress controls. If you are not using...
Trent L. Taylor - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search