Also you might want to put it all into one transaction. The option is to write it out to a file and then bulk insert it.
Chris > -----Original Message----- > From: Ivan Towlson [mailto:[EMAIL PROTECTED] > Sent: Thursday, 8 July 2004 9:30 PM > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] [E500] [ADVANCED-DOTNET] Quick > String question > > Well... it looks from your code like you're making 250000 > round trips to the database. That's got to be expensive. > > -- > Ivan Towlson > White Carbon > > > -----Original Message----- > From: Unmoderated discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] Behalf Of Alex Ben-Ari > Sent: 08 July 2004 12:24 > To: [EMAIL PROTECTED] > Subject: [E500] [ADVANCED-DOTNET] Quick String question > > > The following strategy (semi-pseudo code) is running > extremely slowly, can anyone tell me why and/or point to a > better alternative: > > Assuming I have a Char[] called chr containing the 250MB: > curPos = 0; > While(curPos < chr.Length) { > String segment = new String(chr, curPos, segmentLen); > UpdateDB(segment) > curPos += segmentLen > } > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > Some .NET courses you may be interested in: > > NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles > http://www.develop.com/courses/gaspdotnetls > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com
