Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Programmatically Access Data Behind SQLDataSource Controls

Reply
Thread Tools

Programmatically Access Data Behind SQLDataSource Controls

 
 
MitchW
Guest
Posts: n/a
 
      12-06-2007
Hello,

I have a GridView that is bound to a SQLDataSource. I have enable item
selection on this GridView. I have a button on this .aspx page which does
some work on a different table that what the gridview (SQLDataSource) is
bound to. In order for the button to do its work I need the identity value of
the currently selected item in the GridView or from the SQLDataSource for the
OnClick of the button. How can I get that?

thanks,
mitch


 
Reply With Quote
 
 
 
 
Mohamad Elarabi
Guest
Posts: n/a
 
      12-19-2007
In your onClick event for the button, reference the GridView's SelectedValue
property to get the ID of the selected row. This would be something like this:

MyGridView.SelectedValue

Hope that works.

--
Mohamad Elarabi
Lead Developer. MCTS, MCPD.


"MitchW" wrote:

> Hello,
>
> I have a GridView that is bound to a SQLDataSource. I have enable item
> selection on this GridView. I have a button on this .aspx page which does
> some work on a different table that what the gridview (SQLDataSource) is
> bound to. In order for the button to do its work I need the identity value of
> the currently selected item in the GridView or from the SQLDataSource for the
> OnClick of the button. How can I get that?
>
> thanks,
> mitch
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SqlDataSource Control vs Connecting to a Database Programmatically dcship ASP .Net 3 05-05-2010 09:43 AM
Programmatically using SqlDataSource =?Utf-8?B?cm9kY2hhcg==?= ASP .Net 3 06-12-2007 01:56 PM
What to consider when using SqlDatASource programmatically? Vili ASP .Net 1 04-03-2007 07:53 PM
Programmatically set FilterExpression and FilterParameters of SqlDataSource fuchs.markus@gmail.com ASP .Net 1 08-25-2005 02:24 PM
How to programmatically access ObjectDataSource values (instead of binding to data controls) ASP .Net 2 06-28-2005 07:59 PM



Advertisments