Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 26th, 2006, 06:31 AM
Registered User
 
Join Date: Oct 2006
Location: Cheltenham, , United Kingdom.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Formview with ObjectDataSource

I have come across a problem using the formview with an objectdatasource. When using an object datasource a piece of code like
Button test = (Button)frmvDetails.Controls[0].FindControl("EditButton");
test.Enabled = false;

will generate an error 'Object reference not set to an instance of an object'. Set the formview to reference an SQLDataSource and it is no problem.

I have noticed that if create a new formview and attach it to objectdatasource it will not generate the template code as it does with the SQL code. This is not a problem as it is just a little coding but not being able to reference controls is a problem.

For what I want to do if found the SQLdatasource a problem and the objectdatasource worked really well.

Robert T Turner

  #2 (permalink)  
Old October 31st, 2006, 04:13 PM
Friend of Wrox
 
Join Date: Feb 2006
Location: , , USA.
Posts: 116
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I apologize if this is obvious but did you set up the object data source to be able to update by providing it with an update method on your business object to use for that purpose?

I would guess that the formview you are using might not create the Edit button unless it needed it, and so that led me to my guess. Can you post your code?

Neil Timmerman
Programmer
Veris Consulting
  #3 (permalink)  
Old October 31st, 2006, 04:58 PM
Registered User
 
Join Date: Oct 2006
Location: Cheltenham, , United Kingdom.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for your reply.

I rebuilt the page over the weekend and I ave got it working. I do not know why it didn't work before but it was probably somethingsilly that i did or didn't do.

  #4 (permalink)  
Old November 1st, 2006, 06:17 AM
Registered User
 
Join Date: Nov 2006
Location: bareliiy, up, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

often i havce to face prob server unavaliable tell me the solution to install the .net 2003
i m a beginner and dont knoe the analatical and troublesuting concepe

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ObjectDataSource Best Practices? TKelley4591 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 July 20th, 2007 02:39 PM
FormView/ObjectDataSource/DropDownList Problem davidanderson ASP.NET 2.0 Professional 3 April 14th, 2007 02:50 AM
Problem with ObjectDataSource... veeruu ASP.NET 2.0 Professional 0 March 2nd, 2007 07:45 AM
ObjectDataSource and Wildcards pipelineconsulting ASP.NET 2.0 Professional 1 October 19th, 2006 09:08 PM
ObjectDataSource control ewhizz ASP.NET 2.0 Basics 1 August 15th, 2006 12:09 PM



All times are GMT -4. The time now is 11:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.