Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking 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 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 25th, 2006, 02:43 PM
Registered User
 
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok. took out datasourceid, put dataview in. getting the original error of "Both DataSource and DataSourceID are defined on 'DataView'"

i'm executing the bind within the Private Sub Page_Load
i'm not doing any postbacks --- I'm getting the id via querystring sent from a different page



 
Old August 25th, 2006, 02:48 PM
Registered User
 
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi imar,

thanks for the advice.

i'm already trying to do what you're suggesting; however, the difference is this is a DetailsView and not a GridView. For some reason, I'm getting a "Both DataSource and DataSourceID are defined on 'DataView'. Remove one definition." error when i try to compile.



 
Old August 25th, 2006, 02:52 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

is there anywhere else that you are doing the bind??
is there anywhere that you are setting a datasourceid????

if you take out the original bind, it compiles????

HTH

Gonzalo
 
Old August 25th, 2006, 03:06 PM
Registered User
 
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

okay. my first error was attempting to compile/test without passing an ID in the querystring. now i'm doing that; and, now -- i'm getting "Control 'DataView' of type 'DetailsView' must be placed inside a form tag with runat=server."

 
Old August 25th, 2006, 03:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

now I dont understand you, didn't you just put the control on the page??
it's some kind of weird page????
do you have a form tag???

HTH

Gonzalo
 
Old August 25th, 2006, 04:10 PM
Registered User
 
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

form tag... i wrapped it in a form tag -- that worked.

thanks for your patience.

 
Old August 25th, 2006, 07:41 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Is it working now??

I used a GridView in my code, but the exact same logic and code can be used for other data bound controls like the DetailsView.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old March 21st, 2007, 01:35 AM
Registered User
 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

DataView.DataSourceID = ""
DataView.DataSource = myDataSet
DataView.DataBind();

check this

Cheers...
Wowarjuna

 
Old March 22nd, 2007, 08:58 AM
Registered User
 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a million for that post! I was having a heck of a time reloading the d-view after inserting a new record.
in C# it's

            detailsViewParty.DataSourceID = null;
            detailsViewParty.DataSource = newParty.GetEnumerator();
            detailsViewParty.DataBind();

most appreicated






Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Connection user-defined type not defined Wall st Guru Excel VBA 2 March 26th, 2014 03:44 PM
Object datasource VS DataSource SoftMind BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 July 27th, 2006 10:44 PM
Appl-defined or Object-defined error 1004 chp Excel VBA 3 April 4th, 2006 08:12 AM
User-defined type not defined (Icecream.mdb) dloren01 BOOK: Beginning Access VBA 0 June 22nd, 2005 10:36 PM
Application-defined or object-defined error James Excel VBA 1 August 12th, 2003 11:50 PM





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