Winforms Datagrid Not being populated with correct values..

Tech-Archive recommends: Fix windows errors by optimizing your registry



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?

.



Relevant Pages

  • Re: SqlDataAdapter.Update()
    ... string-chewing algorithm wouldn't work well in SQL. ... looping over words in the string and parsing them off, ... >> Dim cn As New SqlConnection ... >> understood that the data adapter did something like this inside the ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: AS400 to Access
    ... I have a vb program that opens an painfully slow ODBC connection to the 400 ... simply do an Insert for each record into our SQL server, ... > and internal employees I think some of the data will be able to be handled ... > adapter then update the Access OLEDB data adapter using the same dataset. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: ADO.NET SQL Parameters
    ... I tried updating the SQL SELECT statement in my ... suppose the other possibility is to have another data adapter containing the ... "William Vaughn" wrote: ... I want to SELECT rows first based upon one column's values ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ADO.NET SQL Parameters
    ... I figured out how to update the SQL SELECT statement from the IDE ... for instances like this I should just create a "new" data adapter in my code ... I want to SELECT rows first based upon one column's values ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Problems setting up datagrid
    ... > from a SQL Stored Procedure in a different order form how SQL returns it, ... but it is showing up last. ... > showing up as simple text boxes, ... > Ron L ...
    (microsoft.public.dotnet.languages.vb)