X hits on this document

PDF document

“Beginning Visual C# 2005 Express Edition Video Series” - page 60 / 73

185 views

0 shares

0 downloads

0 comments

60 / 73

Wow, that is a long name! Furthermore, if I wanted to create a command object and a data reader from that same namespace, I'd have to add the next two lines of code:

Visual Basic:

Dim cmd As System.Data.SqlClient.SqlCommand Dim dr As System.Data.SqlClient.SqlDataReader

C#:

System.Data.SqlClient.SqlCommand cmd; System.Data.SqlClient.SqlDataReader dr;

To reduce the amount of carpel tunnel, Microsoft allows us to use an Imports statement which makes all the classes in a given namespace available without having to type its full name each time.

Visual Basic:

Imports System.Data.SqlClient ...

Dim con As SqlConnection Dim cmd As SqlCommand Dim dr As SqlDataReader

C#:

using System.Data.SqlClient; ...

SqlConnection con; SqlCommand cmd; SqlDataReader dr;

Supplemental Readings for the Express Edition Videos Copyright © 2005 LearnVisualStudio.NET



Document info
Document views185
Page views185
Page last viewedThu Dec 08 06:38:26 UTC 2016
Pages73
Paragraphs821
Words15988

Comments