C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




question very urgent.


Posted Date: 20 Aug 2008      Total Responses: 1

Posted By: shashi kant       Member Level: Silver     Points: 1


how to read from a rtf file and convert it to excel file



Responses

Author: ANIL PANDEY    20 Aug 2008Member Level: DiamondRating:     Points: 6
hi ,
u can use the Stream Reader and Writer to Write the file

Example

Please rfer the code


Dim strFile As String = "d:\Report.csv"
If File.Exists(strFile) Then
File.Delete(strFile)
End If


Dim objStreamWriter As StreamWriter = New StreamWriter(strFile) '

Dim intRow As Integer
Dim intCol As Integer

For intRow = 0 To ds.Tables(0).Rows.Count - 1
Dim strArrColumns(ds.Tables(0).Columns.Count) As String
For intCol = 0 To ds.Tables(0).Columns.Count - 1
strArrColumns(intCol) = ds.Tables(0).Rows(intRow)(intCol).ToString()
Next
'Writing to file
objStreamWriter.WriteLine(String.Join(",", strArrColumns))

Regards
Anil



Post Reply
You must Sign In to post a response.
Next : Code for print in c#
Previous : question
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use