CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 5/9/2005 3:21:44 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 15 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
chichocojo
Asp.Net User
Object reference not set to an instance of an object.?5/9/2005 3:21:44 PM

0/0

Hi, I keep getting this error when I try to assign a dataset object to datasource property of my custom control, can any body help

......

SqlDataAdapter1.Fill(TestDs1, "Hotels")
DataControl1.DataSource = TestDs1

.......

<Bindable(True), _

Category("Data"), _

Description("The data source used to build up the control."), _

DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _

Public Property DataSource() As DataSet

Get

Return DataSource

End Get

Set(ByVal Value As DataSet)

DataSource = Value

End Set

End Property

nick-w
Asp.Net User
Re: Object reference not set to an instance of an object.?5/11/2005 1:42:54 PM

0/0

Can you show a little more code? Where do you assign Datasource to your control (ie dg.datasource = datasource? What is it being used for?

 

Nick

subdigital
Asp.Net User
Re: Object reference not set to an instance of an object.?5/12/2005 4:46:04 AM

0/0

in your custom control class, I assume you are exposing the Datasource as a property, yes?

Are you doing it like this?

public class SomeControl : Control
{

private [some control type here] dataBoundControl;

public object Datasource
{
get { EnsureChildControls(); return dataBoundControl.Datasource; }
set { EnsureChildControls(); dataBoundControl.Datasource=value; }
}

protected override CreateChildControls()
{
dataBoundControl = new [some control type]();
}
}

Above, the call to EnsureChildControls makes sure that the "CreateChildControls" method is called before you access any private controls.  In the CreateChildControls method you should be instantiating your private controls.

Hope this helps.

Ben Scheirman
http://www.flux88.com
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 2.0 in VB 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1063, Published: 2006
PREMO: A Framework for Multimedia Middleware : Specification, Rationale, and Java Binding Authors: David J. Duke, Ivan Herman, Scott Marshall, Pages: 254, Published: 1999
Accelerated VB 2005 Authors: Guy Fouché, Trey Nash, Pages: 414, Published: 2007
Build Your Own ASP.NET Website Using C# & VB.NET Authors: Zak Ruvalcaba, Pages: 746, Published: 2004
Pro .NET 1.1 Remoting, Reflection, and Threading: From Professional to Expert Authors: Syed Fahad Gilani, Tobin Titus, Mike Gillespie, Fabio Claudio Ferracchiati, David Curran, James Hart, Benny K. Mathew, Sandra Gopikrishna, Andy Olsen, Tejaswi Redkar, Robin Pars, Jon Pinnock, Srinivasa Sivakumar, Pages: 647, Published: 2005
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Java in a Nutshell: A Desktop Quick Reference Authors: David Flanagan, Pages: 1224, Published: 2005
Programming Visual Basic .NET Authors: Jesse Liberty, Dave Grundgeiger, Pages: 541, Published: 2003
Learning Visual Basic .NET Authors: Jesse Liberty, Pages: 303, Published: 2003
Sams Teach Yourself Visual Basic 2005 in 24 Hours: Complete Starter Kit Authors: James D. Foxall, Pages: 536, Published: 2006

Web:
Common causes of: Object reference not set to an instance of an ... Considering the large number of "Object reference not set to an instance of an object" errors abound, I figured its my "public duty" to give the main ...
System.NullReferenceException - Object reference not set to an ... NullReferenceException – “Object reference not set to an instance of an object.” You see people asking about this everywhere; about why are they getting ...
Object reference not set to an instance of an object Techie's ASP ... Feb 14, 2007 ... When you are trying to access a member of a class without instance object you will get Object reference not set to an instance of an object ...
Object reference not set to an instance of an object ... [NullReferenceException: Object reference not set to an instance of an object.] DotNetNuke.Entities.Users.UserOnlineController. ...
BUG: An "Object reference not set to an instance of an object ... Explains that you receive an "Object reference not set to an instance of an object" error when you try to access data by using ADO Interop on an ASP.
Unusual "Object reference not set to an instance of an object ... Filed under: Object reference not set to an instance of an object error ... Filed under: asp.net, Object reference not set to an instance of an object error ...
Object reference not set to an instance of an object - ASP.NET Object reference not set to an instance of an object - ASP.NET Community and Forum - Our ASP.NET forum is the place for Q&A-style ...
"Object reference not set to an instance of an object" error ... Sep 4, 2007 ... NET Framework 2.0, you may receive the error "Object reference not set to an instance of an object" when running EdgeRM. To fix the issue, ...
Error: Object reference not set to an instance of an object - IIS.net In this case, I'm receiving the error "Object reference not set to an instance of an object". I've just set up the server and I'm using SQL ...
Object reference not set to an instance of an object. Object reference not set to an instance of an object. Sunday October 19, 2008. How often do you see this error? If you're like me, you see it a lot. ...

Videos:
Core Patterns for Web Permissions Google TechTalks July 19, 2006 Tyler Close Visiting Scientist Hewlett-Packard Laboratories Mr. Close is a researcher and developer, working in the...
Lec 32 | 8.01 Physics I: Classical Mechanics, Fall 1999 Heat - Thermal Expansion View the complete course: http://ocw.mit.edu/8-01F99 License: Creative Commons BY-NC-SA More information at http://ocw.mit...
Zeitgeist Part 1 - Hearing Impaired [english subtitles] Zeitgeist Part 1 - Hearing Impaired [english subtitles]
fzi_democamp_eclipse_trifu.mov A presentation of the tool inCode at the Karlsruhe Eclipse Demo Camp in 2008
Lec 35 | MIT 8.02 Electricity and Magnetism, Spring 2002 Doppler Effect The Big Bang Cosmology View the complete course: http://ocw.mit.edu/8-02S02 License: Creative Commons BY-NC-SA More information at h...
Zeitgeist, The Movie | Final Edition [ ENGLISH subtitles ] Zeitgeist, The Movie | Final Edition [ ENGLISH subtitles ]
www.moldytoaster.com ection. The fact is, that had he penetrated a little further in the Cul-de-Sac Genrot, he would probably have done so and have been lost. Javert expl...
Lec 19 | 8.01 Physics I: Classical Mechanics, Fall 1999 Rotating Rigid Bodies - Moment of Inertia - Parallel Axis and Perpendicular Axis Theorem - Rotational Kinetic Energy - Fly Wheels - Neutron Stars - P...
An Introduction to SQLite Google TechTalks May 31, 2006 Richard Hipp ABSTRACT SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQ...
From the DVLH Wrestling vault Classic Luke Hadley wrestling music video from 1997. http://www.lukehadley.com Hardcore wrestling is a form of professional wrestling that eschews tr...




Search This Site:










property question

custom datagridcolumn

changes in code have no effect

attribute of custom control - surely there is away

eventargs with text/value properties

styles for treeview

creating sub web applications from a main web app

simple control viewstate question

just cant win

service unavailable when changing from asp.net 1.1 to 2.0 in iis

custom control databinding?

enum property

web control visually

link button issue

render html control within a .net console app

datagrid inherited control with datagrid

need a software distribution host... recommendations?

multiple controls

controls that can hold .aspx page?

have anyone try aspnix.com ?

i cant use my computer as web server

composite control with dropdown losing items after postback

how to implement paging for a repeater?

hosting accounts

building custom controls without visualstudio?

recommendation of asp.net hosting service

how to reload a page(webform1.aspx) on click of a button in .ascx page

control keep state

waiting for all children events before firing event

tagprefix

  Privacy | Contact Us
All Times Are GMT