473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 981

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

Similar topics

1
by: fuchs.markus | last post by:
Hello, on my page, I have a DetailsViewControl connected to a SqlDataSource. Now when I dynamically set the FilterExpression and FilterParameters - for example in a OnClick-EventHandler of a...
0
by: Stu | last post by:
I have a GridView that pulls straight from a table. This uses SqlDataSource1. SqlDataSource2 grabs data from the same table, but only 1 row to fill a DeatilsView, this SqlDataSource2 uses a...
2
by: stuart.d.jones | last post by:
Hi, I'm using a detailsview control with an SqlDataSource control. My Update query isn't working, and I've narrowed it down to the optimistic concurrency parameters - i.e. when I comment them...
3
by: Jim Andersen | last post by:
Just to let you know, and to help any future sorry sods who gets trapped in the same black hole...... You can't just copy/move a working sql-statement into a stored procedure. Working with a...
3
by: K B | last post by:
Hi, I've tried this several ways but get the error that the control can't be found. I have a details view with a dropdownlist in the EditItemTemplate populated and assigned the selected value...
3
by: Asaf | last post by:
Hi, I have SqlDataSource control that makes a "select count" to show how many rows there are in a Table and it is working fine on first page load. The problem is that when I am inserting a new...
1
by: Corey B | last post by:
I have a page with a DetailsView control and a SQLDataSource control. The SQLDataSource control is connected to an Access database. Everything works fine. Now I want to change the back end...
1
by: David Lozzi | last post by:
Howdy, ASP.Net 2.0 using VB on SQL 2005 This is a two fold issue. I have a DetailsView control which users can insert or edit items. Editing works great. Insert works great however I need...
2
by: makennedy | last post by:
Hi Experts, Please help, I am a newbie to ASP.NET 2.0 may be I am doing something wrong or there may be a bug somewhere. Basically I have a TreeView Control which I have created...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.