Greg McGuffey
|
|
Group: Forum Members
Posts: 2K,
Visits: 6.6K
|
I'm going to throw out another approach. Is it possible to just create a fill method that returns just the records you want? You must be determining somehow which records to seek, so why not just use that criterion in the Where clause. You could also do a sort (on SQL, not in BO). Then you just loop through the returned records and do whatever you have to do.
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
OK, back to business... Keith, if you change the column that is the primary key, you'll have to change it back after you are done with your loop in order to add a new record. Also, when you set the PK column back to where it actually is the primary key, you'll also need to set the auto-increment on the column... seed of -1 and value of -1.
|
|
|
Ben Hayat
|
|
Group: Forum Members
Posts: 374,
Visits: 1.2K
|
Ivan George Borges (04/03/2007)
Ben Hayat (04/03/2007)
I did!
With FORTRAN. [Crazy] IBM 360/370 Univac 1108 Fortran Cobol Basic Assembly JCL Algol . . . Hey, Ben. I walked the same path! We should definitely talk about it when we are having Beer "On" Trent.
..ßen
|
|
|
Ben Hayat
|
|
Group: Forum Members
Posts: 374,
Visits: 1.2K
|
Steve L. Taylor (04/03/2007) 1983 - Keith was 10, Trent was 7, Ben was 2 -- ok I am a little older than you guys -- by a freaking lot. I was 31 in 1983.
Either y'all are precocious or maybe I am mature. Actually, I started on punched cards and tape.At one time Icould read Baudot...
I think Ben and Trent are counting the days until the nursing home comes and gets me...Steve, it's great to see you active in design and development. And that's what keeps everyone young...Staying on top of things. Hope to see you when I get to your class!
..ßen
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
Steve L. Taylor (04/03/2007)
1983 - Keith was 10, Trent was 7, Ben was 2 -- ok I am a little older than you guys -- by a freaking lot. I was 31 in 1983. Either y'all are precocious or maybe I am mature. Actually, I started on punched cards and tape. At one time I could read Baudot... I think Ben and Trent are counting the days until the nursing home comes and gets me... I was 19. But I'm not worried... I've decided to live 120 years, so, nothing to worry about.
|
|
|
Keith Chisarik
|
|
Group: StrataFrame Users
Posts: 939,
Visits: 40K
|
Keith Chisarik (04/02/2007) Actually I get an error when calling add() on the BO after adding your code. If I remove your code, it runs fine again, but back to a crawl.
The column is set to not allow nulls, and has a default value of 0 defined.
System.Data.NoNullAllowedException was unhandled by user code
Message="Column 'rent_RPMrecnum' does not allow nulls."
Source="System.Data"
StackTrace:
at System.Data.DataColumn.CheckNullable(DataRow row)
at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Int32 position, Boolean fireEvent, Exception& deferredException)
at System.Data.DataTable.InsertRow(DataRow row, Int32 proposedID, Int32 pos, Boolean fireEvent)
at System.Data.DataRowCollection.Add(DataRow row)
at MicroFour.StrataFrame.Business.BusinessLayer.NewRow()
at MicroFour.StrataFrame.Business.BusinessLayer.Add(Boolean CheckSecurity)
at MicroFour.StrataFrame.Business.BusinessLayer.Add()
at ladesktop.frmSyncTables.syncrentitems(String p_sqlstring) in V:\2005 Projects\LightActionRPMScan\ladesktop\frmSyncTables.vb:line 564
at ladesktop.frmSyncTables.bgwRentitemsSync_DoWork(Object sender, DoWorkEventArgs e) in V:\2005 Projects\LightActionRPMScan\ladesktop\frmSyncTables.vb:line 103
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
this is the problem, can you help with this. I think my problem is misunderstood, the BO.Seek() is horribly slow unless the primary key on the BO is changed to the field I am seeking against as Ben suggested above, BUT when I do this, calling BO.Add() results in the error above even thought I have default values defined for all my "NON NULL" fields.
Keith Chisarik
|
|
|
Ivan George Borges
|
|
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
|
Ben Hayat (04/03/2007)
I did!
With FORTRAN. [Crazy] IBM 360/370 Univac 1108 Fortran Cobol Basic Assembly JCL Algol . . . Hey, Ben. I walked the same path!
|
|
|
Steve L. Taylor
|
|
Group: StrataFrame Developers
Posts: 40,
Visits: 91
|
1983 - Keith was 10, Trent was 7, Ben was 2 -- ok I am a little older than you guys -- by a freaking lot. I was 31 in 1983. Either y'all are precocious or maybe I am mature. Actually, I started on punched cards and tape. At one time I could read Baudot... I think Ben and Trent are counting the days until the nursing home comes and gets me...
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
What's a punch card?
|
|
|
Ben Hayat
|
|
Group: Forum Members
Posts: 374,
Visits: 1.2K
|
I did!
With FORTRAN. [Crazy] IBM 360/370 Univac 1108 Fortran Cobol Basic Assembly JCL Algol . . .
..ßen
|
|
|