Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2008 > C# 2008 aka C# 3.0
|
C# 2008 aka C# 3.0 Discuss the Visual C# 2008 (aka C# 3.0) language
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2008 aka C# 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 7th, 2009, 08:27 AM
Authorized User
 
Join Date: Jul 2007
Posts: 29
Thanks: 2
Thanked 0 Times in 0 Posts
Default Data table column issue.

Hi,
I have a CSV file with two columns in it.
Below is some data from the file:
0000,AllAllowed
0002,SomeAllowed
000A,AlphaAllowed
...., ....

This CSV is read into a table like this:
Code:
OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source= C:\;Extended Properties=""Text;HDR=No;FMT=Delimited""");
                OleDbCommand cmd = new OleDbCommand(sqlSelect, cn);
                OleDbDataAdapter da = new OleDbDataAdapter(cmd);

                dt = new DataTable("TestTable");
                dt.Locale = CultureInfo.InvariantCulture;
                da.Fill(dt);
This data table is then bound to a datagirdview like this:

Code:
BindingSource bsdatabind = new BindingSource();
bsdatabind.DataSource = this.dtperson;
this.dataCenterGridView.DataSource = bsdatabind;
When the data is displayed in the DataGridView it shows only '0' for '0000', '2' for '0002' and completely ignores '000A'.
what do I need to make it display the data as it is in the CSV.

Thanks and Regards.





Similar Threads
Thread Thread Starter Forum Replies Last Post
update one table column from another table column saracom VS.NET 2002/2003 1 February 28th, 2009 04:46 AM
Identity Column Issue mepancha SQL Server 2000 5 June 17th, 2005 03:00 PM
how to make column of table 1 = to column of table gilgalbiblewheel Classic ASP Databases 4 October 11th, 2004 11:57 PM
dataset column not in data base table gbuller ADO.NET 4 August 18th, 2004 10:18 PM
Compare two Items of data(in column A and column B ever Excel VBA 6 February 13th, 2004 02:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.