471,317 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

get data from detailsview

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.
Jan 18 '06 #1
2 5233
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]
- mv*@spam.guard.caspershouse.com

"Dave" <Da**@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
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.

Jan 18 '06 #2
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 [.NET/C# MVP]" wrote:
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]
- mv*@spam.guard.caspershouse.com

"Dave" <Da**@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
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.


Jan 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Andrew Robinson | last post: by
reply views Thread by le0 | last post: by
reply views Thread by wardemon | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.