Click here to Skip to main content
15,892,298 members
Home / Discussions / C#
   

C#

 
QuestionReportViewer VS 2008 Pin
staticv4-Dec-09 2:12
staticv4-Dec-09 2:12 
AnswerRe: ReportViewer VS 2008 Pin
Giorgi Dalakishvili4-Dec-09 3:37
mentorGiorgi Dalakishvili4-Dec-09 3:37 
QuestionAttaching to Membership Database Pin
froofy4-Dec-09 1:15
froofy4-Dec-09 1:15 
AnswerRe: Attaching to Membership Database Pin
Eddy Vluggen4-Dec-09 3:14
professionalEddy Vluggen4-Dec-09 3:14 
GeneralRe: Attaching to Membership Database Pin
froofy4-Dec-09 5:17
froofy4-Dec-09 5:17 
QuestionPerformance tip on extracting BLOB from database? Pin
Thomas ST3-Dec-09 23:38
Thomas ST3-Dec-09 23:38 
AnswerRe: Performance tip on extracting BLOB from database? Pin
Luc Pattyn4-Dec-09 1:49
sitebuilderLuc Pattyn4-Dec-09 1:49 
GeneralRe: Performance tip on extracting BLOB from database? Pin
Thomas ST7-Dec-09 2:43
Thomas ST7-Dec-09 2:43 
So if default packet size for MSSQL 2008 is 4096 (Kbytes?), I could for example try to use 2048 Kbytes wich gives me:
buffersize = 1024*2048=2097152?

And if I want to flush every MB, something like this? :


int startIndex = 0;
int buffersize = 2097152; //(1024*2048=2097152)
byte[] outbyte = new byte[buffersize];

long retval = r.GetBytes(2, startIndex, outbyte, 0, buffersize);
while (retval == buffersize)
{
  bw.Write(outbyte);
  if(startIndex%1048576==0) //FLush every MB? (1024*1024=1048576)
     bw.Flush(); 
  startIndex += buffersize;
  retval = r.GetBytes(WriterTabell.Reader.GetOrdinal("nef_elfil"), startIndex, outbyte, 0, buffersize);
}
bw.Write(outbyte, 0, (int)retval);

//flush, close, dispose


With this code I usually get only 1 loop wich seems to be faster Smile | :)

Is there any way I can find the optimal buffersize? Can .NET do the job for me (without using DataSet)?
GeneralRe: Performance tip on extracting BLOB from database? Pin
Luc Pattyn7-Dec-09 3:15
sitebuilderLuc Pattyn7-Dec-09 3:15 
GeneralRe: Performance tip on extracting BLOB from database? Pin
Thomas ST7-Dec-09 7:23
Thomas ST7-Dec-09 7:23 
AnswerRe: Performance tip on extracting BLOB from database? Pin
PIEBALDconsult4-Dec-09 3:58
mvePIEBALDconsult4-Dec-09 3:58 
GeneralRe: Performance tip on extracting BLOB from database? Pin
Thomas ST7-Dec-09 1:23
Thomas ST7-Dec-09 1:23 
GeneralRe: Performance tip on extracting BLOB from database? Pin
PIEBALDconsult7-Dec-09 4:30
mvePIEBALDconsult7-Dec-09 4:30 
GeneralRe: Performance tip on extracting BLOB from database? Pin
Thomas ST7-Dec-09 7:27
Thomas ST7-Dec-09 7:27 
QuestionDataGridview Drag and drop Pin
anishkannan3-Dec-09 23:04
anishkannan3-Dec-09 23:04 
QuestionNeed sample code Pin
kankeyan3-Dec-09 20:12
kankeyan3-Dec-09 20:12 
AnswerRe: Need sample code Pin
dan!sh 3-Dec-09 20:49
professional dan!sh 3-Dec-09 20:49 
AnswerRe: Need sample code Pin
PIEBALDconsult4-Dec-09 4:00
mvePIEBALDconsult4-Dec-09 4:00 
GeneralC# and timer Pin
nsjn3-Dec-09 19:46
nsjn3-Dec-09 19:46 
GeneralRe: C# and timer Pin
The Man from U.N.C.L.E.3-Dec-09 22:14
The Man from U.N.C.L.E.3-Dec-09 22:14 
GeneralRe: C# and timer Pin
Corinna John3-Dec-09 22:18
Corinna John3-Dec-09 22:18 
GeneralRe: C# and timer Pin
PIEBALDconsult4-Dec-09 4:02
mvePIEBALDconsult4-Dec-09 4:02 
GeneralRe: C# and timer Pin
nsjn4-Dec-09 18:56
nsjn4-Dec-09 18:56 
GeneralRe: C# and timer Pin
nsjn4-Dec-09 21:22
nsjn4-Dec-09 21:22 
QuestionLooking for ideas on how to release memory right before a generation 3 garbage collection [modified] Pin
GWBas1c3-Dec-09 19:23
GWBas1c3-Dec-09 19:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.