473,395 Members | 1,761 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,395 software developers and data experts.

Why SOMETIMES when i try to assign an object to null in immediate window i can't?

TS
I get this message in the window "cannot assign 'null' into 'xxxxx'". this
is an object and hence a reference type. Sometimes this isn't
permitted...why?

thanks
Sep 28 '06 #1
7 1701
Hi TS,

Can you tell me what version of Visual Studio you are using, VS.net2003 or
VS2005? What type of project you are creating, winform, console or Asp.net?
Finally, what language you are using, C# or VB.net? These information will
be helpful for us to accurate identify the problem context. Thanks.

I have tried to use VS2005 with C# language to perform a test in a winform
project. My testing code snippet is listed below:

Form f = new Form();
private void button1_Click(object sender, EventArgs e)
{
}

I set a breakpoint in button1_Click method, once the breakpoint is hit, I
input "this.f=null" in the "Immediate window", I will get the following
result:

this.f=null
null

So, it seems that it works well on my side.

Can you provide a little sample project and detailed reproduce steps to
help me reproduce your problem? I look forward to your feedback. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 29 '06 #2
TS
any comments?

"TS" <ma**********@nospam.nospamwrote in message
news:ug**************@TK2MSFTNGP04.phx.gbl...
>I get this message in the window "cannot assign 'null' into 'xxxxx'". this
is an object and hence a reference type. Sometimes this isn't
permitted...why?

thanks

Oct 5 '06 #3
TS <ma**********@nospam.nospamwrote:
any comments?
There was one from Jeffrey Tan of Microsoft, which was full of
pertinent questions. Please answer those. Most importantly, please
provide a short but complete program which demonstrates your problem.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Oct 5 '06 #4
TS a écrit :
any comments?

"TS" <ma**********@nospam.nospamwrote in message
news:ug**************@TK2MSFTNGP04.phx.gbl...
>I get this message in the window "cannot assign 'null' into 'xxxxx'". this
is an object and hence a reference type. Sometimes this isn't
permitted...why?
Hello,

Perhaps about Structure type, like a DateTime : you cannot assign null toa
DataTime object because it is a srtuct.

HTH.
Oct 5 '06 #5
Hi TS,

I am reviewing this issue thread. It seems Jeffery's reply is omitted. I am
not sure of whether this is a system error. So I pasted it again in the
following. Your further information is quite helpful for the issue
resolution. Thanks very much and look forward to your reply.

-----
From: je***@online.microsoft.com ("Jeffrey Tan[MSFT]")
Date: Fri, 29 Sep 2006 08:57:54 GMT
Subject: RE: Why SOMETIMES when i try to assign an object to null in
immediate window i can't?
Newsgroups: microsoft.public.dotnet.languages.csharp

Hi TS,

Can you tell me what version of Visual Studio you are using, VS.net2003 or
VS2005? What type of project you are creating, winform, console or Asp.net?
Finally, what language you are using, C# or VB.net? These information will
be helpful for us to accurate identify the problem context. Thanks.

I have tried to use VS2005 with C# language to perform a test in a winform
project. My testing code snippet is listed below:

Form f = new Form();
private void button1_Click(object sender, EventArgs e)
{
}

I set a breakpoint in button1_Click method, once the breakpoint is hit, I
input "this.f=null" in the "Immediate window", I will get the following
result:

this.f=null
null

So, it seems that it works well on my side.

Can you provide a little sample project and detailed reproduce steps to
help me reproduce your problem? I look forward to your feedback. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
-----

Sincerely,
Yanhong Huang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 6 '06 #6
TS
i've been viewing posts thru outlook express and it never came over. I just
now see this post and Cyrille37 and Yan-Hong. That is aggrevating because
i've been checking this post every day.

thanks for informing me, i guess OE is quirky. (This has happened before).
i'll check out the other post from the website.

"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP************************@msnews.microsoft.c om...
TS <ma**********@nospam.nospamwrote:
>any comments?

There was one from Jeffrey Tan of Microsoft, which was full of
pertinent questions. Please answer those. Most importantly, please
provide a short but complete program which demonstrates your problem.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Oct 6 '06 #7
TS
First off i'd like to say that I never got this post thru outlook express and
only just now see this post thru the website...

vs 2003, web app, C#

i'm also sorry to say that i have shutdown VS since my post so long ago, and
i cannot retrieve that line from the command window and don't recall which
object i was working with.

When i come across it again, i will make sure to get the code to simulate it
and post it. I do know that i have run across this more than a couple of
times in the last year at different spots.

thanks

""Jeffrey Tan[MSFT]"" wrote:
Hi TS,

Can you tell me what version of Visual Studio you are using, VS.net2003 or
VS2005? What type of project you are creating, winform, console or Asp.net?
Finally, what language you are using, C# or VB.net? These information will
be helpful for us to accurate identify the problem context. Thanks.

I have tried to use VS2005 with C# language to perform a test in a winform
project. My testing code snippet is listed below:

Form f = new Form();
private void button1_Click(object sender, EventArgs e)
{
}

I set a breakpoint in button1_Click method, once the breakpoint is hit, I
input "this.f=null" in the "Immediate window", I will get the following
result:

this.f=null
null

So, it seems that it works well on my side.

Can you provide a little sample project and detailed reproduce steps to
help me reproduce your problem? I look forward to your feedback. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 6 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hai Ly Hoang | last post by:
My application is an MDI. It has an MDI window (main window). Now, I want to create a nother MDI window CMDIFrameWnd *main = new CMDIFrameWnd(); main->LoadFrame(IDR_ANALYSE, WS_OVERLAPPEDWINDOW...
8
by: Sergei | last post by:
Hi, I am displaying modal dialog and passing values from the main form to the modal dialog and back. It works fine but if I used the following syntax on Page_Load(just for testing) in VB to...
20
by: weston | last post by:
I've got a piece of code where, for all the world, it looks like this fails in IE 6: hometab = document.getElementById('hometab'); but this succeeds: hometabemt =...
1
by: mathewda | last post by:
Hey, I'm having a problem that I consider kinda weird that is alluding me at the moment. I've wrote some code that will set up an XMLHttpRequest, it then makes a call to open and send and sets the...
19
by: Mark Rae | last post by:
Hi, Is it possible to have programmatic access to the Page object in Application_BeginRequest, or is it too early in the lifecycle...? E.g. to be able to change a page's MasterPage...
5
by: vul | last post by:
In VB6 I used to use Immediate Window to get or change values of variables. It is very convenient while debugging. I used drag and drop operation to paste the variable name into Immediate Window....
6
by: Frank Rizzo | last post by:
I am using the Immediate Window a lot to see the progress of the application. In VS2003, if your cursor was at the very bottom, the window would scroll down whenever something new showed up. If...
2
by: markszlazak | last post by:
In the following script, a control displays (black box) in each table cell once you mouse over the cell. Mouse down on the control to change the mode of the table. Drag the mouse over cells in the...
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:
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.