Skip navigation

.NET Framework Beta 2

It's here! In November 2000, we released Beta 1 of .NET Framework, and on June 20, we made Beta 2 publicly available. If you attended TechEd in Atlanta, you received both Visual Studio.NET and the .NET Framework. Those who weren't able to attend TechEd can order Visual Studio.NET or simply download the .NET Framework. For more details, see the MSDN Web site.

We're really proud and excited to have Beta 2 complete. If you used .NET Framework Beta 1, thanks—and you're going to love Beta 2! Between Beta 1 and Beta 2, we did quite a bit of work: bug fixes, new features, and API cleanup. This work results in some changes that break Beta 1 code. Let's examine three of these changes:

  • Data Classes
  • ASP.NET Configuration
  • Web Services

Data Classes


If you developed applications with Beta 1 and the application's data was either a database or another OLE DB-accessible data source, you used the classes in the System.Data namespace. Below is one of the Beta 1 samples I used in "Web Services, Part 1":

Imports System.Data
Imports System.Data.SQL

Public Function GetAuthorsData() As DataSet
  Dim conn As SQLConnection
  Dim command As SQLDataSetCommand
  Dim dsn As String
  Dim dataSet as New DataSet()
  
  dsn = "server=localhost;uid=sa;pwd=;database=pubs"
  conn = New SQLConnection(dsn)
  command = New SQLDataSetCommand("select * from Authors", conn)

  command.FillDataSet(dataSet, "Authors")
  
  Return dataSet
End Function

Here's what this code now looks like in Beta 2:

Imports System.Data
Imports System.Data.SqlClient

Public Function GetAuthorsData() As DataSet
  Dim conn As SqlConnection
  Dim dataAdapter As SqlDataAdapter
  Dim dsn As String
  Dim dataSet as New DataSet()
  
  dsn = "server=localhost;uid=sa;pwd=;database=pubs"
  conn = New SqlConnection(dsn)
  dataAdapter = New SqlDataAdapter("select * from Authors", conn)

  dataAdapter.FillDataSet(dataSet, "Authors")
  
  Return dataSet
End Function

Note both the changes in the namespace and the changes in the classes, as well as the use of camelCasing.

ASP.NET Configuration


If you used ASP.NET in Beta 1, you'll notice that in Beta 2, we've changed ASP.NET's configuration system. In Beta 1, we named all configuration files config.web. For Beta 2, we renamed the root configuration file to machine.config and changed all other configuration files to web.config—a minor change, but it does break all Beta 1 apps.

In addition, within the configuration files, we use camelCasing on configuration elements, such as sessionState. The configuration elements are case sensitive, and many element names changed case between Beta 1 and Beta 2.

Web Services


You'll also notice changes in Web Services. My previous two columns (see "Web Services, Part 1" and "Web Services, Part 2") discussed building ASP.NET Web Services on the server, and these Web Services remain largely unchanged. However, under the covers, the system now autogenerates Web Service Description Language (WSDL) contracts instead of Service Description Language (SDL) contracts. This distinction is an important one that I'll cover in more detail in my next column.

Beyond the WSDL contract, we've also added some new functionality: caching and support for client certificates. ASP.NET pages support the concept of output caching—the ability to execute the page on the first request, save the results in the ASP.NET Cache, and reuse the results for multiple requests. Similarly, you can now output-cache a Web Services result by using the CacheDuration property of the WebMethod attribute as below:

C#
\[WebMethod(CacheDuration=60)\]

VB.NET

In both cases, the Simple Object Access Protocol (SOAP) that the system generates for a response is cached for 60 seconds, after which the next request executes and the results are cached for another 60 seconds.

Caching is a huge benefit that you can easily apply to Web Services. For example, a Web service that returns a current weather forecast might be updated only once an hour. Rather than regenerating the SOAP response for each request, you can cache this data and reuse it—increasing both the performance and throughput of the server.

In addition to caching, we've added support for client certificates to ASP.NET Web Services. Applications that call an ASP.NET Web Service can also send an X.509 certificate that can be used for identity on the server. This support provides organizations with yet another option for providing (or assigning) identity to a Web service request.

We've made many changes to .NET between Beta 1 and Beta 2. However, we believe that these changes are necessary to lay a solid foundation for .NET. The good news is that if you're thinking about deploying .NET today, you've picked the right time. The changes between Beta 2 and the release to manufacturing (RTM) version will be minor, mostly bug fixes and performance improvements. In my next column, I'll continue my discussion of ASP.NET Web Services. I'll show you how to update your server code for Beta 2 and walk through using the Web Service from an application.

Corrections to this Article:

  • In the Beta 2 version of the code, the line that reads

    dataAdapter.FillDataSet(dataSet, "Authors")

    should read

    dataAdapter.Fill(dataSet, "Authors")

    We apologize for an inconvenience this error might have caused.
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