469,656 Members | 1,853 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,656 developers. It's quick & easy.

Finding a SQLDatasource control within a DetailsView control

hi, I'm coding a social network style application for my dissertation and am having a few problems, I'm using ASP.net and VB.net

I have a button within a DetailsView control that I want to trigger an Insert for a Datasource that is also within the DetailsView

There is an OnClick event handler for the button but I'm having problems finding the datasource to trigger it the code I'm using is

Expand|Select|Wrap|Line Numbers
  1. Dim DataSource As SqlDataSource = CType(getFriendRequests.FindControl("approveFriend"), SqlDataSource)
  2.  
  3. DataSource.Update()
  4.  

"getFriendRequests" is the name of the Details View and "approveFriend" is the name of the datasource I want to find

using the code above it can't find the datasource and returns a null error

any help would be great,

Thanks

Luke
Mar 29 '07 #1
0 855

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by stuart.d.jones | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.