Connecting Tech Pros Worldwide Forums | Help | Site Map

Work with excel or other ole automation object

Heriberto
Guest
 
Posts: n/a
#1: Nov 16 '05
Hi,

I'd like to know how to work with excel using C#. I known how to do it in
Delphi but I new in C#. I just want a small exemple. And if anyone knows if
there are diferrence working with excel por pocket pc, let me known. I just
want to put some values and format some cells and columns...
Any site or book that I should read?

TIA,
Heriberto



Peter Jausovec
Guest
 
Posts: n/a
#2: Nov 16 '05

re: Work with excel or other ole automation object


Hi,

There are a couple of sites -- try this small example
http://www.c-sharpcorner.com/winforms/ExcelReadMG.asp

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Heriberto" <heriberto@mathemathics.com.br> wrote in message
news:ONYWK6i0EHA.2788@TK2MSFTNGP15.phx.gbl...[color=blue]
> Hi,
>
> I'd like to know how to work with excel using C#. I known how to do it in
> Delphi but I new in C#. I just want a small exemple. And if anyone knows
> if
> there are diferrence working with excel por pocket pc, let me known. I
> just
> want to put some values and format some cells and columns...
> Any site or book that I should read?
>
> TIA,
> Heriberto
>
>[/color]


erdem
Guest
 
Posts: n/a
#3: Nov 16 '05

re: Work with excel or other ole automation object


hi,
as i know, stream classes like , filereader etc are readers that use buffer.
is there any possibility to directly read files from hdd (i need to know
how fast file is read so no buffers should exist)
i mean it is like C
read byte byte from hdd , not from buffered stream
thanks in advance
Erdem Kemer
Nicholas Paldino [.NET/C# MVP]
Guest
 
Posts: n/a
#4: Nov 16 '05

re: Work with excel or other ole automation object


Erdem,

The FileStream class does not use a buffer, rather, it calls the
CreateFile API and then ReadFile. Now, the OS may be doing some buffering,
in which case, you would have to ask for direct file access. Which API you
would use for that though, I do not know. However, once you know which API
to call, you can easily call it through the P/Invoke layer.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"erdem" <erdem@kulube.net> wrote in message
news:uRx8WVj0EHA.1296@TK2MSFTNGP10.phx.gbl...[color=blue]
> hi,
> as i know, stream classes like , filereader etc are readers that use
> buffer.
> is there any possibility to directly read files from hdd (i need to know
> how fast file is read so no buffers should exist)
> i mean it is like C
> read byte byte from hdd , not from buffered stream
> thanks in advance
> Erdem Kemer[/color]


Willy Denoyette [MVP]
Guest
 
Posts: n/a
#5: Nov 16 '05

re: Work with excel or other ole automation object


You can't read byte by byte from a HDD, even a device driver can't do it, a
disk will allways read at least one cluster and cache the data in the HDD
cache.
The OS Filesystem will also cache the data read from the HDD driver, so
everything you do in top of it can't prevent caching.
The only thing you can do is pretend you are reading byte per byte (from
C/C++ or any other language) using FileStream.ReadByte in .NET, but
basically you are only moving a byte at a time from the internal buffer of
the stream to your application defined byte location (heap, stack,
whatever).

Willy.


"erdem" <erdem@kulube.net> wrote in message
news:uRx8WVj0EHA.1296@TK2MSFTNGP10.phx.gbl...[color=blue]
> hi,
> as i know, stream classes like , filereader etc are readers that use
> buffer.
> is there any possibility to directly read files from hdd (i need to know
> how fast file is read so no buffers should exist)
> i mean it is like C
> read byte byte from hdd , not from buffered stream
> thanks in advance
> Erdem Kemer[/color]


scotthe
Guest
 
Posts: n/a
#6: Nov 16 '05

re: Work with excel or other ole automation object


Greetings,

Here are a couple more 'excel'ent sites.
Articles on Office 2003 & code behind (VSTO)
http://msdn.microsoft.com/library/de...VSTMGBLab6.asp
http://msdn.microsoft.com/vstudio/of...stointro_link2
http://www.developer.com/net/cplus/article.php/3289051
http://www.officezealot.com/Office2003Zone/vsto.aspx
http://www.c-sharpcorner.com/OfficeNet.asp
http://msdn.microsoft.com/vstudio/office/default.aspx (Good ones)
http://msdn.microsoft.com/library/de...VSTMGBLab6.asp
http://msdn.microsoft.com/vstudio/of...l/excelobj.asp
http://msdn.microsoft.com/vstudio/of...vstsqlexcl.asp
http://support.microsoft.com/?kbid=306572



"Peter Jausovec" wrote:
[color=blue]
> Hi,
>
> There are a couple of sites -- try this small example
> http://www.c-sharpcorner.com/winforms/ExcelReadMG.asp
>
> --
> Regards,
> Peter Jausovec
> (http://blog.jausovec.net)
> "Heriberto" <heriberto@mathemathics.com.br> wrote in message
> news:ONYWK6i0EHA.2788@TK2MSFTNGP15.phx.gbl...[color=green]
> > Hi,
> >
> > I'd like to know how to work with excel using C#. I known how to do it in
> > Delphi but I new in C#. I just want a small exemple. And if anyone knows
> > if
> > there are diferrence working with excel por pocket pc, let me known. I
> > just
> > want to put some values and format some cells and columns...
> > Any site or book that I should read?
> >
> > TIA,
> > Heriberto
> >
> >[/color]
>
>
>[/color]
Closed Thread