.NETGURU
Excel File Format of ".CVS"
Messages   Related Types
This message was discovered on microsoft.public.dotnet.faqs.

Post a new message to this list...

a@b.c
Dear Programmers,

Could anyone send me to the right location to find code/example on how to
take information from Excel File Format of ".CVS" into VB.Net for data
manipulation?

TIA

Kkaptain

Reply to this message...
 
    
_thedebugger
Hi Tia,
I hope you are talking about .CSV and not .CVS.
(CSV is Comma Seperated Values), which is basically text file.

I worked on this earlier, where I have found this...may be usefull to you.

Here is a solution suggested by Elan Zhou (MS) on the
microsoft.public.dotnet.languages.vb newsgroup.

You can also use the following code:
1. Put a DataGrid on the form.
2. Try the following sample code: (Suppose the csv is c:\test.csv.)

Imports System.Data

Imports System.Data.OleDb

Public Class Form1

Inherits System.Windows.Forms.Form

Dim objDataset1 As DataSet()

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim sConnectionString As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\;Extended Properties=Text;"

Dim objConn As New OleDbConnection(sConnectionString)

objConn.Open()

Dim objCmdSelect As New OleDbCommand("SELECT * FROM
test.csv", objConn)

Dim objAdapter1 As New OleDbDataAdapter()

objAdapter1.SelectCommand = objCmdSelect

Dim objDataset1 As New DataSet()

objAdapter1.Fill(objDataset1, "Test")

DataGrid1.DataSource = objDataset1.Tables(0).DefaultView

objConn.Close()

End Sub

End Class

<a@b.c> wrote in message news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.Data.DataSet
System.Data.OleDb.OleDbCommand
System.Data.OleDb.OleDbConnection
System.Data.OleDb.OleDbDataAdapter
System.EventArgs
System.Object
System.Web.UI.WebControls.DataGrid
System.Windows.Forms.DataGrid
System.Windows.Forms.Form




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification