get sqldatasource field values

  • Thread starter Thread starter Ganesh
  • Start date Start date
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
 
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
 
Back
Top