get sqldatasource field values

G

Ganesh

Hi There,

I've a page with with sqldatasource and detailsview, detailview was assinged
to sqldatasource on design time. Now i would like to display a some fileds
value in text box.

How can i get the values from sqldatasource. Sqldatasource always returns
one row only.

I expect something like ths

string StockName = SqlDatasource.FieldByName("StockName").AsString in my
pageload.

Thanks
 
N

nahid

Hi There,

I've a page with with sqldatasource and detailsview, detailview was assinged
to sqldatasource on design time. Now i would like to display a some fileds
value in text box.

How can i get the values from sqldatasource. Sqldatasource always returns
one row only.

I expect something like ths

string StockName = SqlDatasource.FieldByName("StockName").AsString in my
pageload.

Thanks

hi,
think this way...

DataView oDataView=new DataView();
oDataView =
SqlDataSource1.Select(_DataSourceSelectArguments.Empty);
DataRowView dr = oDataView[0];
string userName = dr("username") as string;

hope help

nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top