473,503 Members | 2,066 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Binding Data to Dataset or Table

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.

Aug 26 '06 #1
3 3206
Jimmy,

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

Cor

"JimmyKoolPantz" <ko*******@gmail.comschreef in bericht
news:11*********************@p79g2000cwp.googlegro ups.com...
>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.

Aug 26 '06 #2
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)

Cor Ligthert [MVP] wrote:
Jimmy,

Most likely your connection string, but if you don't show that, than the
chance that somebody can help you is zero.
Aug 26 '06 #3
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/micro...75aac56c0fba44

I hope this helps,

Cor
"JimmyKoolPantz" <ko*******@gmail.comschreef in bericht
news:11**********************@m73g2000cwd.googlegr oups.com...
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)

Cor Ligthert [MVP] wrote:
>Jimmy,

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

Aug 27 '06 #4

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

Similar topics

6
7469
by: Omar | last post by:
When I try to databind my comboBox (specifically field "emplcode") to a filled dataset , the contents of the comboBox displays a bunch of "System.Data.DataRowView". I assume the amount of times...
13
4282
by: Paul Slavin | last post by:
I have a textbox bound to a dataview, when I update the text in the textbox no changes take place in the underlying dataset. Why is this?? any answers appreciated, as to due to the underlying...
4
12282
by: bardo | last post by:
Does anyone knwo how I can bind a textbox to a single dataset/dataTable row? The following will give me only a Column: textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text",...
3
1562
by: Lloyd Sheen | last post by:
I am having trouble with an app that does the following: 1. Query SQL Server and return one row 2. Bind the columns to text boxes 3. User updates info 4. User clicks update button ...
5
2897
by: Ashwani Gaur | last post by:
Hi all, It may be a very simple query, but i am stuck with having millions of record showing instantly in chunks of 100 or 200 record(not a paging concept), in vb i use to bind the data to ado...
1
2613
by: Bruce | last post by:
Hi, there, I meet a problem about comboBox binding. -------------------- Database: Northwind Tables: 1) Products 2) Categories I create a form (named "form1") to edit the record from...
4
4602
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
6
5719
by: p.mc | last post by:
Hi all, I'm having major problems with a userControl which contains a datagrid. My problem concerns data binding. The Page_Load() procedure calls the DataBind procedure to bind the datagrid...
0
2065
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
6
4745
by: =?Utf-8?B?VmVybm9uIFBlcHBlcnM=?= | last post by:
I am having trouble with the binding of a check box. I have a form for editing and adding reps. I am using a bindingsource and a bindingnavigator. I have on the form an "Active" checkbox, which...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
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
7348
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...
0
5592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5021
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.