Skip navigation

The .NET Framework

Welcome to the .NET Developer Toolkit! My name is Rob Howard, and I'm a program manager on the .NET Frameworks team at Microsoft. Specifically, I work on the ASP.NET feature of the .NET Framework, but I won't limit this column to discussions of ASP.NET. Instead, I'll cover a wide variety of technical discussions all related to the .NET Framework. If you have suggestions for column topics, or feedback, please email me at [email protected] with ".NET Developer Toolkit:\[subject\]" in the subject line of your message. Or, you can post your suggestions as a Reader Comment.

In this column, I provide an overview of the .NET Framework; in subsequent columns I'll assume familiarity with the technology.

Most developers would never claim knowledge of only one language; in fact, knowledge of only one language could be a "career-limiting move" because projects can vary from VBScript to Java. As developers, we might be more adept in one language, but more typically, we know several languages (e.g., C++, Java, and Visual Basic—VB).

One of the greatest difficulties in learning any language is usually not the language semantics/syntax, but rather the class libraries used to enable that language to solve problems. Class libraries are almost never consistent across languages. For example, database access in C++, Java, and VB all look quite different. The difference among the class libraries translates to lower productivity because developers can't possibly be proficient in each language's libraries.

Entirely eliminating the learning curve for new libraries and languages obviously isn't possible; however, one goal of the Microsoft .NET platform is to make the libraries consistent. .NET is a multilanguage platform that supports a common set of libraries known as the .NET Framework. Compiler vendors for such languages as Perl and COBOL are re-engineering their compilers to support Microsoft .NET; in addition, Microsoft provides four .NET languages: C++, C#, VB, and JScript.

Developers can write class libraries, such as a data-access library, in any language that supports the .NET platform. Any other .NET language can then use those class libraries. For example, a COBOL developer could write a library to interact with a mainframe to do transaction processing. Later, a developer who wanted to use that class library in a Web application could use VB to access the COBOL class library and integrate it through VB calls.

The .NET Framework is a language-neutral class library that Microsoft provides. It contains classes for building Web and Windows applications, classes for working with network protocols and accessing databases, and many other classes. A developer using a .NET-supported language can use the classes that the framework provides to code an application. More importantly, rather than learning both a language and a class library for that language, developers need to learn only the language's semantics because the only difference regarding class libraries is the syntax used within a language to access the class libraries.

Take, for example, the code snippets below, which access a SQL Server database using VB and C#, respectively:

VB:

Dim conn As SQLConnection
Dim command As SQLDataSetCommand
Dim dataSet as New DataSet()

conn = New SQLConnection("server=localhost;uid=sa;pwd=;database=pubs")
command = New SQLDataSetCommand("select * from Authors", conn)

command.FillDataSet(dataSet, "Authors")

C#:

SQLConnection conn;
SQLDataSetCommand command;
DataSet dataSet = new DataSet();

conn = new SQLConnection("server=localhost;uid=sa;pwd=;database=pubs");
command = new SQLDataSetCommand("select * from Authors", conn);

command.FillDataSet(dataSet, "Authors");

Both code examples first create some local variables and an instance of a DataSet. Next they create new instances of type SQLConnection and SQLDataSetCommand, passing the appropriate values for the respective class constructors. Finally, both use the command variable's FillDataSet() method to populate the DataSet variable dataSet with values (naming the table in the DataSet "Authors").

In a future column, I'll discuss the DataSet class, which is a new way of working with data in .NET. Rather than the ADO style of data access (e.g., forward read-only cursor on an open database connection), a DataSet is a disconnected representation of the data. But meanwhile, what you should take away from the above code samples is that both VB and C# use the same class libraries and the same methods to interact with the class libraries. Had we used COBOL or Perl, we would have used the same classes (e.g., SQLConnection), differing only in the semantics/syntax of how that language interacts with the class.

Microsoft .NET encompasses a wide, but focused, vision for what application development will look like for the foreseeable future. It addresses many areas such as Web services, deep XML support, cross-language inheritance, memory management, a consistent class library (.NET Framework), and great tools for development.

TAGS: SQL
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish