cancel
Showing results for 
Search instead for 
Did you mean: 

problem in populating matrix through user data source

Former Member
0 Kudos

Hi

I am trying to populate the matrix (by clicking a button)through user data source and using the setLineData function.

First time It populates accurately,

But when I again click the same button then before populating the matrix It shows the last record in all of the rows added in the matrix and then it override those records,which seems very eratic.

i am also using clear method but still it shows.

please help...

I am using the following code.......

while(!oRS.EOF)

{

int j=1;

for(int i=1;i<oMatrix.Columns.Count;i++)

{

oForm.DataSources.UserDataSource.Item(oMatrix.Columns.Item(i).DataBind.Alias).Value=oRS.Fields.Item(i-1).Vlue;

}

oMatrix.SetLineData(j++);

}

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Sharma,

//first split you nested statement into smaller parts so that you can easilty debug through .NET,

// the second time when it is behaving bad.

//oForm.DataSources.UserDataSource.Item(oMatrix.Columns.Item(i).DataBind.Alias).Value=oRS.Fields.Item(i-1).Vlue;

Try using

int i=0;

oMatrix.Clear();

while(!oRS.EOF){

//pick up data from recordset into user data source

//fill all columns

oMatrix.AddRow(1, i++);

}

//if it intermittent may be because of .NET GC, release

// COM reference and force collection

oRS=null;

GC.Collect();

GC.WaitForPendingFinalizers();

Answers (0)