Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

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....????
0
sonbinary
Asked:
sonbinary
  • 3
  • 2
1 Solution
 
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
 
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
BlackTigerXCommented:
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
 
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now