I am trying to read my IIS log files. Some times I am successful while other times I get the following error, &#039;String or binary data would be truncated. The statement has been terminated.&#039;<BR><BR>This is probably the response from a stored procedure that is suppose to be passed variables but is not passing all of them after a certain amt of time. I believe only part of the values are sent to the stored procedure and that&#039;s the reason for this error. The reason for not passing all the values is below.<BR><BR>I added a section to write the current line to a temp text file before I process the certain values and the last line in this temp text file after the error is like half the log file. Is it possible that a StreamReader times out? It will actually read all the files if I just read the file by itself but when I add calls to the database and other functions in the ... more code section.<BR><BR>NOTE: My original way was to do the objStreamReader.ReadToEnd() but it did the same thing.<BR><BR>If anyone has any ideas I would be welcome to them.<BR><BR>The is how my code is structured:<BR>[code language="ASP.NET"]<BR>Dim objStreamReader as StreamReader<BR>Dim objStreamWriter as StreamWriter<BR>Dim arrArray2() as String<BR>Dim iMax as Integer<BR>Dim sInput as String<BR><BR>objStreamWriter = File.AppendFile(MapPath("logfile_output.txt"))<BR> objStreamReader = File.OpenText(FILENAME)<BR>sInput = objStreamReader.ReadLine()<BR><BR>&#039;Loop until end of file is reached<BR>While sInput &#060;&#062; Nothing<BR> &#039;Write the current file to my test file<BR> objStreamWriter.WriteLine (sInput)<BR> &#039;Split the current log file into an array that is space delimited<BR> arrArray2 = sInput.Split(" ")<BR> iMax = arrArray2.Length<BR> If iMax &#062; 6 Then<BR> &#039;... more code that calls stored procedure goes here<BR> End If<BR> sInput = objStreamReader.ReadLine()<BR>End While<BR><BR>&#039;Close reader and writer objects<BR>objStreamReader.Close()<BR>objStreamWri ter.Close()<BR>[/code]<BR><BR>Normal logs are like:<BR>DATE TIME GET /images/filegif - IP HTTP/1.1 Mozila/..... Visitor HTTP 200 500 349<BR><BR>But my last log line is:<BR>DATE TIME GET /images/filegif - IP HTTP/1.1 Moz<BR><BR>So it seems like it&#039;s not writting all of the line in the log due to some reason. My code does work on most first but wondering if larger log files can cause issues.