C# Intellisence different that VB?

  • Thread starter Thread starter Tina
  • Start date Start date
T

Tina

I'm a VB.Net developer trying to learn C# but there are some strange
differences that none of the books or articles I have cover. For
instance....

SqlConnection connCP = new SqlConnection();

connCP.

When I type that last period in VB, Intellsense shows me all of the
properties, methods, etc of my new connCP object. But in C# is shows me
nothing. I even compiled after entering the first line.

Is C# Intellsense different that VB or is my code wrong?

Thanks,

Tina
 
Yeah. Your issue probably stems from the fact the VB.NET and Visual
Studio automatically Imports common namespaces into the project. You
propable didn't realize it was doing this for you behind the scenes. On
the other hand, in C# you have manually add the imports.
 
tdavisjr said:
Yeah. Your issue probably stems from the fact the VB.NET and Visual
Studio automatically Imports common namespaces into the project. You
propable didn't realize it was doing this for you behind the scenes. On
the other hand, in C# you have manually add the imports.

But he claims that it compiled the first line.
 
Nick Hounsome said:
But he claims that it compiled the first line.

Indeed. I've seen it do this too, but normally when I have a bit of code
elsewhere that is in correct (i.e. I missed off a semicolon or something)
but then that wouldn't have compiled either...
 
I already have it there.

Could it be that C# intellisense is not as effective as with VB? Maybe
because of VB's background compiler?
T
 
I have all of the necessary imports. It even fails to expose connCP methods
when I spell them all out explicitly.
T
 
Tina,

I had tha same problem and as soon as I added "using System.Data.SqlClient"
it worked
I have no idea.
Restart your machine.....

SA
 
I have all of the necessary imports. It even fails to expose connCP methods
when I spell them all out explicitly.
T

Check your intellisense settings. Are they set to automaticaly show or
do you have to push a short cut first (ie ctrl+space).
 
The intellisense setting are the same for C# and VB in VS.net. Besides,
intellisense appears to work ok when entering framework objects.
T
 
Back
Top