473,386 Members | 1,812 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,386 software developers and data experts.

Winforms Datagrid Not being populated with correct values..

Here is a very strange problem that is difficult to explain.

I am populating a datagrid with a datatable. I had to add an
additional field to my data adapter/datatable which I have to reference
during my update.

The field should have values such as:

767
790
801
834....

Instead, its showing this:

0
1
2
3
4...all the way to the number of rows I have.

It's like it's showing the row index rather than the correct data.

I've checked my SQL Data Adapter and the ID is showing up correctly in
the preview. I've put the SQL Statement into SQL Query Analyzer and
its working fine there too.

It seems to be getting changed when it hits the dataset.

I've been trying to figure this out for three hours now and it makes
absolutely no sense.

Has this ever happened to anyone else?

Oct 19 '05 #1
1 1379
I figured out what is going on. Since that column is an incrementing
ID field, it's setting the datatable field to auto-increment. When
turned that off and allowed nulls, for some strange reason the IDs are
not populating into the datatable when I do the fill. So it naturally
starts at zero and works its way up.

This absolutely makes no sense at all. Why wouldnt it populate my
datatable with these values?

Im about to tear my hair out!

Oct 19 '05 #2

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

Similar topics

0
by: Gamze | last post by:
Hi, How can i get values from datagrid to combobox and should select the same name as in datagrid row on the combobox control In my vb.net windows application ,i have combobox which is...
0
by: JR | last post by:
Hello, Does anyone know how you can prevent a row full of 'null' values from being added to the datagrid when a user hits the delete key, deleting the word (null) which represents the default...
0
by: Shane O. Pinnell | last post by:
I am sure this has come up before, but I haven't been able to find an answer as of yet. That said, any help is definitely appreciated! I have a datagrid populated from a dataset. I have a...
1
by: m3ckon | last post by:
Hi there, please help if you can, I'm having an issue with droponnlists in a datagrid I have a datagrid which is populated from a query .. all works fine I've added two extra columns, one...
13
by: Lyners | last post by:
I have a web page writen in ASP.NET that contains some javascript so that when a user presses a button, or edits a certain field in a datagrid, another cell in the datagrid is filled with a value....
1
by: Hanover | last post by:
Here is a very strange problem that is difficult to explain. I am populating a datagrid with a datatable. I had to add an additional field to my data adapter/datatable which I have to reference...
13
by: shookim | last post by:
I don't care how one suggests I do it, but I've been searching for days on how to implement this concept. I'm trying to use some kind of grid control (doesn't have to be a grid control, whatever...
1
by: zaidpapa | last post by:
Hi, I am very new to ASP.Net, kindly help me. This is what i want to do. I am primarily working on two classes PatientInfo and PatientInfoUtility. PatientInfo: PatientInfo is the class object that...
8
by: Brock | last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The reason for this is that I want the user to be able to change values without updating the database, but still have their report...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.