You are currently viewing the WinForms/Console Application Design section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
I need to write a windows app (vb 2005) that does following:
1. Imports a .csv file
2. Selects certain rows from the .csv file
3. Splits the .csv file into fields based on delimiter
4. Populate a db2/400 table with only some of the fields.
Need to select only rows with "Paid Check". Field3, field4, field5, field6 and field7 only will be inserted into the db2/400 table.
Does anyone have code sample I could use? Thank you.
Google is your friend (and usually faster that us)...
Try: import cvs file and parse vb.net
Lot's of links (code, libraries and others!!) If you have any question about what you found, ask again.
__________________
HTH
Gonzalo
================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification : WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the proof.
================================================== =========
The Following User Says Thank You to gbianchi For This Useful Post:
I have the code in place to fill my data set, it works fine.
Question: In my "Select..." clause is it possible to to a "%Like" and get only rows that have the phrase "Paid Check"?
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\;Extended Properties=Text;"
Dim myConnection As New OleDbConnection(myConnectionString)
myConnection.Open()
Dim myCmdSelect As New OleDbCommand("SELECT * FROM SunTrust.csv", myConnection)
Dim myAdapter As New OleDbDataAdapter()
myAdapter.SelectCommand = myCmdSelect
Dim myDataset As New DataSet()
myAdapter.Fill(myDataset, "Suntrust")
myConnection.Close()
End Sub
mmm.. not sure, you don't have fields definitions..
but what about filter the dataset after you loaded it??
__________________
HTH
Gonzalo
================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification : WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the proof.
================================================== =========