Using Extra Columns in SQLDataSource

D

Don Miller

I have controls (dropdown list, radiobutton list) that are bound to an
SQLDataSource. In the SELECT statement in the DataSource configuration I
have tried to include other columns that would be useful to do something
with (e.g. store in an object, textbox, etc.) besides just populating the
databound control.

Is there way to access these extra columns in a SQLDataSource or do I have
to forget the DataSource control, query the database and populate the
controls and other desired items "manually"?

Thanks for any tips.
 
E

Eliyahu Goldin

No need to populate the controls manually. When your task grows over the
typical and trivial, abandon the declarative databinding and go for the old
good DataSource property (as opposed to DataSourceID). Create a dataset,
populate the datatable and databind to it.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
D

Don Miller

Thanks. It took me awhile to find the available properties for a control
(like DataSource) since most don't show up in the Design view but they are
all there in Source view.

Eliyahu Goldin said:
No need to populate the controls manually. When your task grows over the
typical and trivial, abandon the declarative databinding and go for the
old good DataSource property (as opposed to DataSourceID). Create a
dataset, populate the datatable and databind to it.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


Don Miller said:
I have controls (dropdown list, radiobutton list) that are bound to an
SQLDataSource. In the SELECT statement in the DataSource configuration I
have tried to include other columns that would be useful to do something
with (e.g. store in an object, textbox, etc.) besides just populating the
databound control.

Is there way to access these extra columns in a SQLDataSource or do I
have to forget the DataSource control, query the database and populate
the controls and other desired items "manually"?

Thanks for any tips.
 

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