How does type faster in C# ???

I have an example  procedure  like that :

private void Form1_Load(object sender, System.EventArgs e)
{
      SqlClient.SqlConnection a=new SqlClient.SqlConnection();
}

When I declare a SqlConnection variable, I must remember the name of SqlConnection ....so how can I declare it faster like VB.NET....????
sonbinaryAsked:
Who is Participating?
 
BlackTigerXConnect With a Mentor Commented:
if you want to declare it dinamically here it is:

if you have

using System.Data.SqlClient;

previously in your using statements

all you would have to type would be

- "sqlCon" (Ctrl + Space, then select from the list, it'll be the first in the list, so just hit enter)
- " a = new " (note the space at the end)
- it then automatically comes up with the autocomplete list with sqlConnection selected by default, so you just hit enter
0
 
tzxie2000Commented:
you can add an sqlconnection form toolbox to your form and change the property from IDE enviroment
this may be more easy to coding your program
0
 
tzxie2000Commented:
you can add an sqlconnection from toolbox to your form and change the property from IDE enviroment
this may be more easy to coding your program
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
sonbinaryAuthor Commented:
SqlConnection has just an example.....All  object in NET FRAMEWORK, if I want to declare an object...I must remeber it....In VB.NET , we easy to declare it....
example : dim a  as .....a list box appear and we will choose what object we want...
0
 
BlackTigerXCommented:
oh... if you just want that list hit Ctrl+Space will do the same thing
0
 
BlackTigerXCommented:
that's one of the things they're thinking about how to shorten in the next version of C#, so you don't have to type the type name twice like now
type variable = new type();
0
All Courses

From novice to tech pro — start learning today.