Solved

How does type faster in C# ???

Posted on 2004-09-11
6
235 Views
Last Modified: 2010-04-15
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
Comment
Question by:sonbinary
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:tzxie2000
ID: 12034069
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
 
LVL 5

Expert Comment

by:tzxie2000
ID: 12034074
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
 

Author Comment

by:sonbinary
ID: 12034178
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 13

Accepted Solution

by:
BlackTigerX earned 250 total points
ID: 12034196
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
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 12034198
oh... if you just want that list hit Ctrl+Space will do the same thing
0
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 12034203
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now