Changing column order in typed dataset

G

Guest

I create a typed dataset based upon a table, using the VS2005 designer. I
then add a query to the table adapter with a select statement, changing the
order of some columns, and removing others. When I select preview data, I
see the columns in the original order of the dataset, with the columns I
removed now showing up as empty. This can't be by design, can it? And if
so, how can I order the columns?

Since I am using stored procedures, I can drop the select stored procedure
in the TDS and the resulting column order is correct, but I am now using a
different table adapter. Are there any other options?

Thanks,

David R
 
C

Cor Ligthert [MVP]

David,

A strongly typed dataset is simple a class for yourself (your organisation)
that is build by inheriting a DataSet. In that class are rules build in. In
Net we have now 3 different ones for that:
The Version 1.x which are the same for Web and windowforms
The Versions 2.0 where the windowform and the webform have a different
approach.

In those classes are no options to relocate the columns at run time.

In a non typed dataset (datatable) by the way is it as well a hell of a job
to do what your ask. Because the column is only a description of the items
used in the datatypes. Therefore do you have to copy the table, remove the
columns from original and by looping insert the rows again with the new
sequence of the columns.

And than the only reason is to not use styles in datagrid, what is much
simpler to do than all I wrote above.

I hope this gives an idea,

Cor
 
G

Guest

Cor,

Thanks for the response. I decided to turn the autogenerate property of the
datagridview to false, and add the columns manually, in the order I wanted.

You mentioned that you have found the TDS to be implemented differently in
NET 2.0 for Windows forms vs ASP.NET. Could you list some of the
differences you have found?

Thanks,
 
C

Cor Ligthert [MVP]

David,
Thanks for the response. I decided to turn the autogenerate property of
the
datagridview to false, and add the columns manually, in the order I
wanted.

You mentioned that you have found the TDS to be implemented differently in
NET 2.0 for Windows forms vs ASP.NET. Could you list some of the
differences you have found?
Would be the same as writing the differences between a Ford and a Boeing

I hope you don't mind that I don't do that.

Cor
 
G

Guest

No problem. I'll be seeing that soon enough, as the project that I am
developing has both Win forms and ASP.NET portions, all feeding from some of
the same datasets.
 
L

Laser Lu

Excuse me, what is TDS? What does that stand for? Forgive my emptiness,
please:)
I looked up from some SQL Server related documentation, and I found a
definition for TDS is 'Tabular Data Stream' protocol, although I'm not sure
about it.
How to use TDS in the .net programming then? Any replies would be
appreciated!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top