get data from detailsview

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a detailsview connected to a SqlDataSource. I have a button on a form
that needs to take some of the data from the detailsview and do some stuff
with it. Is there anyway to get the data from the detailsview?

Thanks in advance.
 
Dave,

Is there any way you can connect it to a DataSet instead, and then pass
that through the viewstate? This way, on the other side, you can get the
dataset and then process that when you click the button on the form.

Hope this helps.
 
The following code does what I need,

string a = DetailsView2.SelectedValue.ToString();

Where a is the current key value of the DetailsView2. This works with
SqlDatasource, or a dataset.

Nicholas Paldino said:
Dave,

Is there any way you can connect it to a DataSet instead, and then pass
that through the viewstate? This way, on the other side, you can get the
dataset and then process that when you click the button on the form.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Dave said:
I have a detailsview connected to a SqlDataSource. I have a button on a
form
that needs to take some of the data from the detailsview and do some stuff
with it. Is there anyway to get the data from the detailsview?

Thanks in advance.
 

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

Back
Top