Click here to Skip to main content
15,913,854 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionVB.Net Pin
Bongumusa4-Sep-08 5:29
Bongumusa4-Sep-08 5:29 
AnswerRe: VB.Net Pin
Blue_Boy4-Sep-08 5:44
Blue_Boy4-Sep-08 5:44 
AnswerRe: VB.Net Pin
Paul Conrad4-Sep-08 11:11
professionalPaul Conrad4-Sep-08 11:11 
AnswerRe: VB.Net Pin
Jon_Boy5-Sep-08 1:49
Jon_Boy5-Sep-08 1:49 
QuestionUsing CSV File As Data Reference Pin
Codemonkey854-Sep-08 5:10
Codemonkey854-Sep-08 5:10 
AnswerRe: Using CSV File As Data Reference Pin
Steven J Jowett4-Sep-08 12:55
Steven J Jowett4-Sep-08 12:55 
AnswerRe: Using CSV File As Data Reference Pin
Mycroft Holmes4-Sep-08 15:22
professionalMycroft Holmes4-Sep-08 15:22 
GeneralRe: Using CSV File As Data Reference Pin
Codemonkey855-Sep-08 8:19
Codemonkey855-Sep-08 8:19 
So, I followed your advice and tried going with a data table. However, my code is just plain not producing results.

I frequently ask my code to msgbox me values here and there to see what's going on, and the last batch of code I posted, as well as this one, seems to ignore these msgbox requests, or the code is somehow not executing. I'm not getting a message box.

Below is the sub that I run when the form loads:

Private Sub ReadCSVToDataTable()
        'http://vbcity.com/forums/topic.asp?tid=119121

        'Dim dt As New DataTable 'class level

        'in a method
        Dim constr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\;Extended Properties=""text;HDR=Yes;FMT=Delimited"""

        Dim conn As New OleDbConnection
        conn.ConnectionString = constr
        Dim cmd2 As New OleDbCommand

        cmd2.Connection = conn
        cmd2.CommandText = "Select * From All_Item_Prices.csv"
        Dim da As New OleDbDataAdapter(cmd2)
        Try
            da.Fill(dt)
        Catch ex As OleDbException
            MessageBox.Show(ex.Message)
        End Try

        Dim row0col1 As String = dt.Rows(0).Item(1).ToString

        'In the above code, the following assumptions were made:
        '1) file is located in F:\ directory
        '2) file name is testA.txt
        '3) the file is a comma delimited file
        '4) the file does not contain a header row

        'MsgBox(dt.Rows(1))


    End Sub


Any ideas?

As I sit here, I contemplate the last words of Socrates: "I drank what?".

Pokémon Pearl Friend Code: 4554-2418-6836

GeneralRe: Using CSV File As Data Reference Pin
Mycroft Holmes5-Sep-08 13:32
professionalMycroft Holmes5-Sep-08 13:32 
GeneralRe: Using CSV File As Data Reference Pin
Codemonkey855-Sep-08 19:20
Codemonkey855-Sep-08 19:20 
GeneralRe: Using CSV File As Data Reference Pin
Mycroft Holmes5-Sep-08 22:43
professionalMycroft Holmes5-Sep-08 22:43 
GeneralRe: Using CSV File As Data Reference Pin
Codemonkey856-Sep-08 1:54
Codemonkey856-Sep-08 1:54 
QuestionHi I am new user this site My subject(PHP) Pin
jitendra.rajkot4-Sep-08 3:59
jitendra.rajkot4-Sep-08 3:59 
AnswerRe: Hi I am new user this site My subject(PHP) Pin
Ashfield4-Sep-08 4:36
Ashfield4-Sep-08 4:36 
AnswerRe: Hi I am new user this site My subject(PHP) Pin
Paul Conrad4-Sep-08 11:12
professionalPaul Conrad4-Sep-08 11:12 
QuestionCalling a function gives me very unhelpful error message Pin
DerekFL4-Sep-08 3:51
DerekFL4-Sep-08 3:51 
AnswerRe: Calling a function gives me very unhelpful error message Pin
Steven J Jowett4-Sep-08 4:39
Steven J Jowett4-Sep-08 4:39 
GeneralRe: Calling a function gives me very unhelpful error message Pin
DerekFL4-Sep-08 4:47
DerekFL4-Sep-08 4:47 
QuestionHow to open ms word form vb.net to a particular bookmark? Pin
Chaitanya kumar CVSS4-Sep-08 3:29
Chaitanya kumar CVSS4-Sep-08 3:29 
AnswerRe: How to open ms word form vb.net to a particular bookmark? Pin
John Ad4-Sep-08 3:51
John Ad4-Sep-08 3:51 
QuestionHow we genrate Help File in VB6 Pin
Amit Battan Ror4-Sep-08 0:09
Amit Battan Ror4-Sep-08 0:09 
AnswerRe: How we genrate Help File in VB6 Pin
ChandraRam4-Sep-08 1:22
ChandraRam4-Sep-08 1:22 
AnswerRe: How we genrate Help File in VB6 Pin
Rajesh Anuhya4-Sep-08 1:30
professionalRajesh Anuhya4-Sep-08 1:30 
QuestionCutomize Setup VB6 Pin
Amit Battan Ror4-Sep-08 0:06
Amit Battan Ror4-Sep-08 0:06 
AnswerRe: Cutomize Setup VB6 Pin
ChandraRam4-Sep-08 1:19
ChandraRam4-Sep-08 1:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.