Error Creating Control (Object reference not set to an instance of an object.)

Error Creating Control (Object reference not set to an instance of an object.)

Post by Pierre Menga » Wed, 14 Aug 2002 18:41:34



Hello,

In the designer view of VS.NET this is what is displayed (see the subject)
when using my custom control.

I have no idea what is the problem.

Can someone tell me if there are anything to do to find the error ? Object
reference not set to an instance of an object... ok, but where ?

Thanks a lot !

Pierre Mengal

 
 
 

Error Creating Control (Object reference not set to an instance of an object.)

Post by Ilia » Wed, 14 Aug 2002 19:29:29


Could you post HTML markup code for your control? Sounds
like you didn't specify an ID property or didn't put a
closing tag.

 
 
 

Error Creating Control (Object reference not set to an instance of an object.)

Post by Pierre Menga » Wed, 14 Aug 2002 19:42:38


Hello,

No all is OK, closing tag, runat, id, etc... This is really an internal
problem. But can't find where.

Strange heh ?



Quote:> Could you post HTML markup code for your control? Sounds
> like you didn't specify an ID property or didn't put a
> closing tag.

 
 
 

Error Creating Control (Object reference not set to an instance of an object.)

Post by Ilia » Wed, 14 Aug 2002 20:10:50


Pierre,
Is it C# or VB? What kind of control is it? You can also
check whether your control is initialized in the code
behind, like:
protected System.Web.UI.WebControls.Label lblMyLabel;

>-----Original Message-----
>Hello,

>No all is OK, closing tag, runat, id, etc... This is
really an internal
>problem. But can't find where.

>Strange heh ?




>> Could you post HTML markup code for your control? Sounds
>> like you didn't specify an ID property or didn't put a
>> closing tag.

>.

 
 
 

Error Creating Control (Object reference not set to an instance of an object.)

Post by Pierre Menga » Wed, 14 Aug 2002 20:23:55


Hello again,

C#, this is a composite control. Can't copy paste the code here, ... more
than 4.000 lines of code.

All is well initialized on the user part. And the most strange is that the
control work fine when the page is executed. All is ok else the fact that in
the Design View, I have that insane message "Error Creating Control" with in
the ToolTip : "Object reference not set to an instance of an object.".

Strange strange...



Pierre,
Is it C# or VB? What kind of control is it? You can also
check whether your control is initialized in the code
behind, like:
protected System.Web.UI.WebControls.Label lblMyLabel;

>-----Original Message-----
>Hello,

>No all is OK, closing tag, runat, id, etc... This is
really an internal
>problem. But can't find where.

>Strange heh ?




>> Could you post HTML markup code for your control? Sounds
>> like you didn't specify an ID property or didn't put a
>> closing tag.

>.

 
 
 

Error Creating Control (Object reference not set to an instance of an object.)

Post by Ilia » Wed, 14 Aug 2002 20:45:44


Hello again Pierre,

Hmm, it runs fine but still giving a message in design
view? I've seen this error couple of times - try closing
and then re-open your project or even restart a computer.

Quote:>-----Original Message-----
>Hello again,

>C#, this is a composite control. Can't copy paste the
code here, ... more
>than 4.000 lines of code.

>All is well initialized on the user part. And the most
strange is that the
>control work fine when the page is executed. All is ok

else the fact that in
Quote:>the Design View, I have that insane message "Error

Creating Control" with in
>the ToolTip : "Object reference not set to an instance of
an object.".

>Strange strange...




>Pierre,
>Is it C# or VB? What kind of control is it? You can also
>check whether your control is initialized in the code
>behind, like:
>protected System.Web.UI.WebControls.Label lblMyLabel;

>>-----Original Message-----
>>Hello,

>>No all is OK, closing tag, runat, id, etc... This is
>really an internal
>>problem. But can't find where.

>>Strange heh ?




>>> Could you post HTML markup code for your control?
Sounds
>>> like you didn't specify an ID property or didn't put a
>>> closing tag.

>>.

>.

 
 
 

1. error: object reference not set to an instance of an object

Hi,

This is my code but i am getting an error:

object reference not set to an instance of an object

  Dim mySelectText As String = "SELECT * FROM equ_ren"
            Dim mySelectConn As String = "Integrated
Security=SSPI; Persist Security Info=False;Initial
Catalog=equipment_rental;Data Source=GMSSGCESD001"
            Dim myDataAdapter As New SqlDataAdapter
(mySelectText, mySelectConn)
            Dim InsertCmd As String = "Update equ_ren set
type = '" & type.text & "', brand = '" & brand.text & "',
model = '" & model.text & "',"
                InsertCmd = InsertCmd & " serial_no = '"
& sn_no.text & "', status = '" & status.text & "',
renting_company = '" & renting_company.text & "',"
                InsertCmd = InsertCmd & " end_user = '" &
end_user.text & "', inst_loc = '" & inst_loc.text & "',
inst_date =  " & inst_dt.text & ","
                InsertCmd = InsertCmd & " rent_bill_date
= " & rent_bill_dt.text & " ,bill_period = '" &
bill_period.text & "',"
                InsertCmd = InsertCmd & " inst_billed
= '" & inst_billed.SelectedItem.Value & "', lan_IP= '" &
lan_IP.text & "' where serial_no = '" & sn_no.text & "';"

            myDataAdapter.UpdateCommand.CommandText =
InsertCmd
            myDataAdapter.UpdateCommand.Connection = CType
(myDataAdapter.SelectCommand.Connection, SqlConnection)

thanks for sparing ur valuable time.

cheers

prasanna

2. iPod: Any car rechargers other than connection kit?

3. Object reference not set to an instance of an object error

4. Acorn NFS/Omniclient efficiency

5. Object Reference Not Set to an Instance of an Object error when calling unmanaged DLL function

6. Will there ever be BCC support?

7. error: Object reference not set to an instance of an object

8. Webexplorer & MS Word

9. error: "Object reference not set to an instance of an object"

10. SQL Errors: Object reference not set to an instance of an object.

11. Crystal Reports-Error: Object reference not set to an instance of an object.

12. Custom class error: "Object reference not set to an instance of an object."

13. System.Exception: Mid-Object reference not set to an instance of an object.