Below is the code to read the contents from a document which is in sharepoint document library:
string contents =
(SPSite site = new
(SPWeb web = site.RootWeb)
file = web.Folders["http://sp2007:33051/Library1"].Files["kundandoc12.docx"];
(StreamReader reader = new StreamReader(file.OpenBinaryStream()))
Disclaimer: The purpose of this site is to share the knowledge with experience.
All the contents are truth of our knowledge. Any way our website is not liable for
any type of data discrepencies and changes in data.