Contact
Send mail to the author(s) Email Me

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Sign In
Navigation

Tag Cloud
.NET Framework (31) AJAX (9) ASP.NET (16) ASP.NET MVC (3) C# (32) Cloud (2) Database (6) Dev Community (2) Dev Tools (5) Enterprise Library (1) Futures (2) General (6) Javascript (7) LINQ (2) Mobile (1) MSDTC (5) Quotes (3) SQL (3) Transactions (4) WAS (2) WCF (19) WIF (1) Visual Studio (3)

Archive
<November 2006>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

Categories

Blogroll
Home Feed your aggregator (RSS 2.0)
# Saturday, November 04, 2006

I record only a few shows on my DVR.  While fast-forwarding through commercials during last night's Battlestar Galactica, I saw a familiar image and had to rewind.  Ahhh... and then it appeared as a voice said "Tonight's episode is brought to you by Microsoft Visual Studio 2005."  Seeing that made me feel twice as dorky for watching that show.

Saturday, November 04, 2006 4:13:48 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   General  | 
# Tuesday, August 29, 2006
Tuesday, August 29, 2006 8:51:51 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   .NET Framework | C#  | 
# Monday, August 28, 2006

The 2006 Jacksonville Code Camp was great. I spent the whole day in the Code Countdown room cranking our code for a worthy cause. Shawn Weisfeld, David Silverlight and I wrote a web app from scratch with ASP.NET for a non-profit organization in Pennsylvania. I'm happy that I was able to participate in the first Code Countdown, and help a non-profit organization. You can volunteer to help out in a similar way by checking out David Silverlight's site, www.nonprofitways.com.

Monday, August 28, 2006 8:53:50 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   General  | 
# Tuesday, November 08, 2005

This 2.1 update includes over 60 improvements, including new support for .NET 2.0 and Visual Studio 2005. VistaDB is a small-footprint, embedded SQL database alternative to Jet/Access, MSDE and SQL Server Express 2005 that enables developers to build .NET 1.1 and .NET 2.0 applications. Features SQL-92 support, small 500KB embedded footprint, free 2-User VistaDB Server for remote TCP/IP data access, royalty free distribution for both embedded and server, Copy 'n Go! deployment, managed ADO.NET Provider, data management and data migration tools. Free trial is available for download.

Tuesday, November 08, 2005 9:55:01 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   .NET Framework | C# | Database  | 
# Tuesday, August 30, 2005

Rick Strahl delivered another excellent white paper. In addition to his white papers, he has one of the most readable and intelligent blogs on the web.

White paper: Past the AJAX Hype - some things to think about

Tuesday, August 30, 2005 8:57:57 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   AJAX | ASP.NET | Javascript  | 
# Friday, August 12, 2005

Yesterday, S. Somasegar, Corporate Vice President, Developer Division (Microsoft) shared some fantastic news, in his blog, about a new language enhancement in C# 2.0. In addition to Generics, Anonymous Methods, Iterators, and Partial Types, we will now have nullable types. Also, more details on MSDN about nullable types

Friday, August 12, 2005 8:58:43 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   .NET Framework | C#  | 
# Tuesday, August 09, 2005

I have read too many articles showing the connection being opened and closed around a DataAdapter Fill() as in the code below. It does no harm, but it not necessary.

Don't do this...

SqlCommand command = new SqlCommand("usp_MyQuery_Select", this._con);
SqlDataAdapter adapter = new SqlDataAdapter(command);
DataSet ds = new DataSet();
try
{
   this._con.Open(); //unnecessary
   adapter.Fill(ds);
}
finally
{
   this._con.Close(); //unnecessary
}

Do this...

SqlCommand command = new SqlCommand("usp_MyQuery_Select", this._con);
SqlDataAdapter adapter = new SqlDataAdapter(command);
DataSet ds = new DataSet();
adapter.Fill(ds);

If you track SqlDataAdapter's Fill() method in Lutz Roeder's .NET Reflector, you will see that it ends up at DbDataAdapter's FillFromCommand() method. FillFromCommand() opens and closes the connection in a try-finally block. Making this unnecessary in your own code.

Disassembled from Reflector

private int FillFromCommand(object data, int startRecord, int maxRecords,
   string srcTable, IDbCommand command, CommandBehavior behavior)
{
   IDbConnection connection1 = DbDataAdapter.GetConnection(command, "Fill");
   ConnectionState state1 = ConnectionState.Open;
   if (MissingSchemaAction.AddWithKey == base.MissingSchemaAction)
   {
      behavior |= CommandBehavior.KeyInfo;
   }
   int num1 = 0;
   try
   {
      try
      {
         DbDataAdapter.QuietOpen(connection1, out state1);
         using (IDataReader reader1 = command.ExecuteReader(
            behavior | CommandBehavior.SequentialAccess))
         {
            if (data is DataTable)
            {
               return this.Fill((DataTable) data, reader1);
            }
            return this.Fill((DataSet) data, srcTable, reader1, startRecord, maxRecords);
         }
      }
      finally
      {
         DbDataAdapter.QuietClose(connection1, state1);
      }
   }
   catch
   {
      throw;
   }
   return num1;
}

Tuesday, August 09, 2005 8:59:40 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   .NET Framework | C#  | 
Copyright © 2010 Scott Klueppel. All rights reserved.