FILES WITH C# (VS 2003)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I need to open flat files using C#.
I need to work very fast, but when I used StreamReader, This is very slow.

Anybody knows how to work FILES very fast using C#.
I need to read 3 millions of records at least a minute.

How can i access FILES very fast (flat files)?

Thanks for your help

Macisu
 
Macisu,

Are you running a race or something? That is an awful amount of records
to be reading.

How are you processing them? Just saying that it is very slow isn't
really good enough, since we can't see how you are processing the stream
(there may be optimizations you can make which you aren't).
 
I need to load the file in SQL SERVER.

This file has information about savings accounts and is necesary to load
very fast for other tasks. For Now, I used bulk insert copy.

But, When i used Visual Basic 6, this is very fast using
Open File for input #1
etc.
why?
What can i do using c#?




Nicholas Paldino said:
Macisu,

Are you running a race or something? That is an awful amount of records
to be reading.

How are you processing them? Just saying that it is very slow isn't
really good enough, since we can't see how you are processing the stream
(there may be optimizations you can make which you aren't).


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Macisu said:
Hi

I need to open flat files using C#.
I need to work very fast, but when I used StreamReader, This is very slow.

Anybody knows how to work FILES very fast using C#.
I need to read 3 millions of records at least a minute.

How can i access FILES very fast (flat files)?

Thanks for your help

Macisu
 
Macisu,

Did you check the link that was posted in the other reply? It shows
some ways of using the FileStream that improve performance by quite a bit.

You also haven't shown how you are processing the file, and your
algorithm could be part of the problem as well.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Macisu said:
I need to load the file in SQL SERVER.

This file has information about savings accounts and is necesary to load
very fast for other tasks. For Now, I used bulk insert copy.

But, When i used Visual Basic 6, this is very fast using
Open File for input #1
etc.
why?
What can i do using c#?




Nicholas Paldino said:
Macisu,

Are you running a race or something? That is an awful amount of
records
to be reading.

How are you processing them? Just saying that it is very slow isn't
really good enough, since we can't see how you are processing the stream
(there may be optimizations you can make which you aren't).


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Macisu said:
Hi

I need to open flat files using C#.
I need to work very fast, but when I used StreamReader, This is very
slow.

Anybody knows how to work FILES very fast using C#.
I need to read 3 millions of records at least a minute.

How can i access FILES very fast (flat files)?

Thanks for your help

Macisu
 
Inline.

Willy.

Macisu said:
I need to load the file in SQL SERVER.

This file has information about savings accounts and is necesary to load
very fast for other tasks. For Now, I used bulk insert copy.

But, When i used Visual Basic 6, this is very fast using
Open File for input #1
etc.
why?
What can i do using c#?
If you can do it using VB6,you can do it with C#, of course without seeing
any it's impossible to tell what issues you have.
I guess, the problem is not the file reading, but the DB insert's that are
slowing down the process.

Nicholas Paldino said:
Macisu,

Are you running a race or something? That is an awful amount of
records
to be reading.

How are you processing them? Just saying that it is very slow isn't
really good enough, since we can't see how you are processing the stream
(there may be optimizations you can make which you aren't).


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Macisu said:
Hi

I need to open flat files using C#.
I need to work very fast, but when I used StreamReader, This is very
slow.

Anybody knows how to work FILES very fast using C#.
I need to read 3 millions of records at least a minute.

How can i access FILES very fast (flat files)?

Thanks for your help

Macisu
 
Back
Top