473,385 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

CSV Confusion...

Hi All...

I'm having a bit of difficulty displaying results into a datagrid. My search
queries a .CVS file.

The Code is as follows:

Dim DS As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter

Dim MyConnection As System.Data.OleDb.OleDbConnection

MyConnection = New
System.Data.OleDb.OleDbConnection(provider=Microso ft.Jet.OLEDB.4.0; data
source=C:\; Extended Properties='text;HDR=No;FMT=Delimited'")

MyCommand = New System.Data.OleDb.OleDbDataAdapter( select * from test.csv",
MyConnection)

DS = New System.Data.DataSet()

MyCommand.Fill(DS)

DataGrid1.SetDataBinding(DS, "test")

MyConnection.Close()

Why can't I display this in a datagrid?

Thank you so much for your contribution.

Juan
Nov 20 '05 #1
2 1070
Cor
Hi Juan,

Try this,
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
path & ";Extended Properties=""Text;HDR=No;FMT=Delimited\"""

Your CSV has to be in your culture setting.

I hope this works?

Cor
Nov 20 '05 #2
On Thu, 12 Feb 2004 15:40:26 +0200, "Juan" <ju****@cs-solutions.co.za> wrote:

¤ Hi All...
¤
¤ I'm having a bit of difficulty displaying results into a datagrid. My search
¤ queries a .CVS file.
¤
¤ The Code is as follows:
¤
¤ Dim DS As System.Data.DataSet
¤ Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
¤
¤ Dim MyConnection As System.Data.OleDb.OleDbConnection
¤
¤ MyConnection = New
¤ System.Data.OleDb.OleDbConnection(provider=Microso ft.Jet.OLEDB.4.0; data
¤ source=C:\; Extended Properties='text;HDR=No;FMT=Delimited'")
¤
¤ MyCommand = New System.Data.OleDb.OleDbDataAdapter( select * from test.csv",
¤ MyConnection)
¤
¤ DS = New System.Data.DataSet()
¤
¤ MyCommand.Fill(DS)
¤
¤ DataGrid1.SetDataBinding(DS, "test")
¤
¤ MyConnection.Close()
¤
¤
¤
¤ Why can't I display this in a datagrid?
¤
¤ Thank you so much for your contribution.

It isn't clear what type of problem you are having. Are you getting errors? Is the format incorrect?
What is the field delimiter?

Perhaps you could post a few lines from your text file.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Doug Farrell | last post by:
Hi all, I'm trying to do the following from within a code module: import re # text to match text = "Good morning x something /x, how are you today x something else /x"
1
by: Mathias Mamsch | last post by:
Hi, I have some confusion concerning the weakref module. I am trying to save a weak reference to a bound member function of a class instance for using it as a callback function. But I always...
38
by: Grant Edwards | last post by:
In an interview at http://acmqueue.com/modules.php?name=Content&pa=showpage&pid=273 Alan Kay said something I really liked, and I think it applies equally well to Python as well as the languages...
10
by: Kamilche | last post by:
I'm trying to pack two characters into a single byte, and the shifting in Python has me confused. Essentially, it should be possible to use a 'packed string' format in Python, where as long as...
4
by: JMCN | last post by:
object invalid or no longer set - confusion of the recordset in access 2003. i am currently converting from access 97 to access 2003. majority of the codes converted over perfectly fine, though...
0
by: i_have_control | last post by:
I'd be grateful for any input on this one: I have three web domains. The destinations of two are set to folders on the first, though that fact is transparent to the user (i.e: it does not...
13
by: Steve | last post by:
I have a form with a dataset and a datagrid. I created a dataview on this dataset. When the user modifies the datagrid, I look up this record in the dataview to make sure it is unique. Here is...
10
by: joelagnel | last post by:
hi friends, i've been having this confusion for about a year, i want to know the exact difference between text and binary files. using the fwrite function in c, i wrote 2 bytes of integers in...
1
by: Richard Lewis Haggard | last post by:
I'm having a problem with what appears to be some sort of confusion with references. I have a single solution with a dozen projects which has been working quite nicely for a while. The references...
2
by: Riaaaa | last post by:
Hello, We are doing the project in VB.Net. We had a great confusion for ASP.Net and VB.Net. Is VB.Net project performed in Microsoft Visual Studio 2005 ?? We have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.