C# Intellisence different that VB?

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
 
T

tdavisjr

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.
 
N

Nick Hounsome

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.
 
J

james

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...
 
T

Tina

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
 
T

Tina

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

MSDN

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
 
C

Chris Chilvers

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).
 
T

Tina

The intellisense setting are the same for C# and VB in VS.net. Besides,
intellisense appears to work ok when entering framework objects.
T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top