Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / August 2006

Tip: Looking for answers? Try searching our database.

Binding Data to Dataset or Table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JimmyKoolPantz - 26 Aug 2006 07:23 GMT
I have an ongoing problem that I can not seem to figure out.

The problem is everytime I bind data to a dataset or datatable where
the data source does not have a "header row" the first record in the
datafile always shows up in the header of the dataset or table.

Is there a simple solution to this problem?  I have tried different
connection strings with extended properties "HDR=Yes" and I have tried
"HDR=NO" but nothing seems to work.  the only solution I have found is
to bind the datafile to the dataset and then create a new table with
column headers and then pull the first record out of the header of the
dataset.  However, I am looking for qucker processing time.

The problem files that I have came across are text files, and .csv
files.  I am using vs.2005.

Also, since every datafile is in a different format, I can not set
connection properties at design time, I need to do this at runtime.
Some of the files I deal with are 80,000 records long, so you can see
why I do not want to import the data in the dataset, and then create a
new table and process the reocords again.
Cor Ligthert [MVP] - 26 Aug 2006 09:18 GMT
Jimmy,

Most likely your connection string, but if you don't show that, than the
chance that somebody can help you is zero.

Cor

>I have an ongoing problem that I can not seem to figure out.
>
[quoted text clipped - 17 lines]
> why I do not want to import the data in the dataset, and then create a
> new table and process the reocords again.
JimmyKoolPantz - 26 Aug 2006 20:32 GMT
The two connections strings that I wrote about are:
text files(odbc connection)
cs = "Driver={Microsoft Text Driver (*.txt; *.csv)};DBQ=" + FilePath

excel files(oledb connection)
cs = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FilePath +
";Extended Properties=""Excel 8.0;IMEX=1"""

I have tryed using extended properties "HDR=YES" and HDR=NO" and still
the first record was still in the header, however, I might not have
coded it correctly or overlooked something.
cs = "Driver={Microsoft Text Driver (*.txt; *.csv)};DBQ=" + FilePath +
";Extended Properties=YES" (I have tried NO also)

> Jimmy,
>
> Most likely your connection string, but if you don't show that, than the
> chance that somebody can help you is zero.
Cor Ligthert [MVP] - 27 Aug 2006 06:01 GMT
Jimmy,

Mostly has this to do with the quotes you are using, and I think that it is
in your case the same.

Both Ken and Paul have written something about your question in this thread

http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_frm/t
hread/4bb49f484a9b3b5c/fb75aac56c0fba44?#fb75aac56c0fba44


I hope this helps,

Cor

> The two connections strings that I wrote about are:
> text files(odbc connection)
[quoted text clipped - 14 lines]
>> Most likely your connection string, but if you don't show that, than the
>> chance that somebody can help you is zero.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.