473,569 Members | 2,700 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 3213
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*******@gmai l.comschreef in bericht
news:11******** *************@p 79g2000cwp.goog legroups.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={Micros oft Text Driver (*.txt; *.csv)};DBQ=" + FilePath

excel files(oledb connection)
cs = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" + FilePath +
";Extended Properties=""Ex cel 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={Micros oft 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*******@gmai l.comschreef in bericht
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
The two connections strings that I wrote about are:
text files(odbc connection)
cs = "Driver={Micros oft Text Driver (*.txt; *.csv)};DBQ=" + FilePath

excel files(oledb connection)
cs = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" + FilePath +
";Extended Properties=""Ex cel 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={Micros oft 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
7473
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 "System.Data.DataR..." is displayed inside the combobox is the amount of records in the dataset. On the other hand, if my query is "select emplcode...
13
4291
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 structure of the datasets, i.e lots of child tables etc, I cannot use bindingcontext
4
12298
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", this.myDataTable, "TableNaam")) But in my program I need a textbox (that I can edit) directly bound to a fixed cel in a Dataset/ dataTable.
3
1568
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 Questions: 1. Is data binding one direction.
5
2898
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 datacontrol which is binded to datagrid and data is instantly shown using ado events and methods in a user friendly manner i.e data is shown and...
1
2617
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 Products table.
4
4606
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 bound to a table as a lookup, drawing values from another table to populate the available selections. This all worked fine in VB6. I have...
6
5730
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 to a DataSet. If i include an if statement to prevent the data binding from occuring on a page PostBack in the following way:
0
2067
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 end of this message, but I will start with an overview of the problem. I've made a content management solution for my work with a decently...
6
4752
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 is bound to the IsActive field in the bound data table. It works fine for the reps that are already in the table. The problem occurs when I click...
0
7698
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.