Thursday, January 21, 2010

I am upgrading around 100 projects from 2.0 and 3.5 and was wondering if there was a bulk update in VS 2008 that I wasn't aware of.

 

Doing some searching it would seem not

http://stackoverflow.com/questions/1914489/change-the-target-framework-for-all-my-projects-in-a-visual-studio-2008-to-3-5

One alternative would be write an application to add a few items to the csproj file.

(System.Data.Entity added to target 3.5 SP1)

http://msdn.microsoft.com/en-us/library/bb398197.aspx

 

In the end I did it manually

 

 

Thursday, January 21, 2010 10:40:40 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Wednesday, February 27, 2008

http://www.windowsitpro.com/mobile/pda/Article.cfm?ArticleID=98404&News=1

Didn't VS2008 get launched last year?

http://www.noelwatson.com/blog/PermaLink,guid,a2c68db2-3cc8-4024-bb91-46d4067f9557.aspx

It doesn't seem long since VS2005 and SQL 2005 were launched

http://www.noelwatson.com/blog/PermaLink,guid,1e4ec06d-b1d6-40cf-97a1-db9f9b71f29a.aspx

I will make the effort to upgrade the web server to 2008 when the next installment of the action pack arrives.

 | 
Wednesday, February 27, 2008 8:01:43 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Tuesday, November 20, 2007
Tuesday, November 20, 2007 7:49:17 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Thursday, August 02, 2007

I've been developing a CDO pricing model and am introducing threading so I can spawn it out onto multiple machines. I used BackgroundWorker as a starting point but found it impossible to debug. This article explains why

http://blogs.msdn.com/greggm/archive/2005/11/18/494648.aspx

 

Thursday, August 02, 2007 4:55:30 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Friday, January 05, 2007
Friday, November 10, 2006
Monday, November 06, 2006

Ability to scale to more than 100000 messages/sec

http://www.microsoft.com/windowsserver/facts/casestudies/lse.mspx

Good to see Microsoft pushing more into the financial sector - contradicts John Davies statement

http://www.noelwatson.com/blog/PermaLink,guid,32742325-fec7-44be-98d2-2f64b7578d79.aspx

Monday, November 06, 2006 9:04:48 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Wednesday, October 25, 2006

http://www.theserverside.com/news/thread.tss?thread_id=42563

Very biased towards Java (banks do write real time trading applications in .NET - my client is one of them), but worth listening to as it gives a good idea of what tools are being used in banks i.e. Tibco Rendezvous, and what the Java equivalent is for the .NET stuff we do.

Also worth reading the comments in the thread afterwards. One of the things discussed is "in memory" databases -

http://www.oracle.com/timesten/index.html

Oracle have TimesTen, but I can't find anything being developed over at Microsoft.

Wednesday, October 25, 2006 7:07:04 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Monday, October 23, 2006
Tuesday, October 17, 2006
Tuesday, October 17, 2006 11:22:05 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Monday, October 16, 2006
Monday, October 16, 2006 3:05:32 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Friday, September 01, 2006

I installed SQL 2005 developer edition on a server for evaluation purposes yesterday. After installation, I had to enable remote connections (doesn't apply to other versions)

The first piece of new functionality I wanted to look at was asynchronous commands

The connection string changes slightly from pre AD0.NET 2.0

Integrated Security=SSPI;Initial Catalog=xxxx;Data Source=xxxx;Async=true;MultipleActiveResultSets=true

with "Async=true" signifying asynchronous behaviour and "MultipleActiveResultSets=true" stating that we want multiple result sets on the same connection.

My test involved retrieving around 250 resultsets - synchronously this took 3.2 seconds whereas asynchronously this took 1.2 seconds. This was undertaken on a twin processor machine with hyperthreading (hyperthreading and SQL may not always be a good idea)

http://blogs.msdn.com/slavao/archive/2005/11/12/492119.aspx

so effectively a 4 proc machine. Hogging all the processors for the code I had in mind should not be a problem as the database is not heavily used, but the improved response using asynchronous execution may come in handy.

A good article for asynchronous commands is listed below

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/async2.asp

Asynchronous commands are a feature of ADO.NET 2.0 so will work against SQL 2000, whereas MARS requires SQL 2005

http://msdn2.microsoft.com/en-us/library/h32h3abf.aspx

 | 
Friday, September 01, 2006 3:46:41 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Tuesday, August 29, 2006

http://msdn.microsoft.com/vstudio/default.aspx?pull=/library/en-us/dnvs05/html/TEDBPro.asp

Our CDS application has gone into staging so I have some time to look at SQL 2005 and VS2005. Installation currently underway.

Tuesday, August 29, 2006 4:21:02 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Monday, August 21, 2006
Sunday, August 20, 2006

Not much fanfare over this one with VS2005 available

http://www.microsoft.com/downloads/details.aspx?FamilyID=69D2219F-CE82-46A5-8AEC-072BD4BB955E&displaylang=en

List of fixes

http://support.microsoft.com/default.aspx?scid=kb;en-us;918007

I'm probably not going to bother installing it as we are planning to roll out on .NET 2.0 in the next few months.

Sunday, August 20, 2006 12:37:40 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Thursday, June 01, 2006

Announced yesterday. CTP will be available in June (Tech Ed) and released at the end of the year.

http://www.itnewsonline.com/showstory.php?storyid=4125&scatid=4&contid=3

http://msdn.microsoft.com/vstudio/teamsystem/products/dbpro/

http://blogs.msdn.com/mattnunn/archive/2006/06/01/612572.aspx

Some of the tools it is offering, especially integrated source control, will be invaluable.

Thursday, June 01, 2006 12:30:59 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Tuesday, May 02, 2006

http://www.developerday.co.uk/ddd/default.asp

I would be tempted to go if it wasn't on a Saturday in the middle of Summer!

Tuesday, May 02, 2006 3:59:46 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Tuesday, April 25, 2006
Tuesday, April 25, 2006 5:27:00 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Thursday, March 30, 2006
Thursday, March 30, 2006 7:20:32 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Monday, March 20, 2006

After posting about Web 2.0 today

http://www.noelwatson.com/blog/PermaLink,guid,b8496159-335c-4d61-8cc8-f2b5bc084c31.aspx

I got an email informing me that MS have released the March CTP of Atlas

http://atlas.asp.net/Default.aspx?tabid=47

If I were doing web development I would get up to speed on this, but find myself working on Winforms apps these days. MS use the following site as an example of what can be done

http://www.pageflakes.com/

 | 
Monday, March 20, 2006 8:23:33 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Monday, March 06, 2006

http://www.learn2asp.net/Campaign.aspx

Unfortunately it's only the standard edition (£200 R.R.P.),

http://www.checknowsoftware.com/uk/shop/pc/viewPrd.asp?pid=2819

but it's better than nothing if you haven't got MSDN, and it offers more than the free express editions

http://msdn.microsoft.com/vstudio/products/compare/default.aspx

Monday, March 06, 2006 1:10:44 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Monday, February 20, 2006

This went very smoothly. After backing everything up, I uninstalled the framework and SQL 2005 beta 2. Installing SQL 2005 installs the 2.0 framework by default, The only 2 gotchas were

 

allowing the extension for the correct version of .NET

setting ASP.NET to run under the correct version. Windows 2003 comes with Framework 1.1 installed as standard and I don't believe you can "officially" uninstall it.

 | 
Monday, February 20, 2006 9:06:53 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
  • Retake offer on selected exams

http://www.microsoft.com/learning/mcp/offers/2ndchance/thankyou/default.asp

  • Three free beta exams available

Exam 71-547 Pro - Designing and Developing Web-based Applications by Using the Microsoft .NET Framework (promo code: PRO547)
Exam 71-548 Pro - Designing and Developing Windows-based Applications by Using the Microsoft .NET Framework (promo code: BTA548) 
Exam 71-549 Pro - Designing and Developing Enterprise Applications by Using the Microsoft .NET Framework (promo code: 549BTA)

This follows on from some exams released for beta recently (552-554)

http://www.noelwatson.com/blog/PermaLink,guid,8f62f25d-6d3c-4cdc-b73b-3ae7cbf3b72b.aspx

  • Three exams are Live

http://www.microsoft.com/learning/exams/70-528.asp

http://www.microsoft.com/learning/exams/70-431.asp

http://www.microsoft.com/learning/exams/70-441.asp

 

I am probably doing the CQF this year, so will leave the MS upgrades until next year.

 |  | 
Monday, February 20, 2006 12:15:29 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Thursday, February 16, 2006

DV01 is the sensitivity to a shift in the curve of 1 bp

Assuming the spread and interest rate curves are reasonably flat, the formula is

DV01=(1-exp(-(r+h)*t))/(r+h)

where h (hazard rate)=(spread/(1-recovery))*365/360

Taking GM

http://www.noelwatson.com/blog/PermaLink,guid,a5cd0517-0d1c-41e6-9bfc-f379327afb93.aspx

Term = 5

Spread = 1440bp

Interest rate = 4.6%

http://www.treas.gov/offices/domestic-finance/debt-management/interest-rate/yield.html

Recovery Rate = 39%

This gives a DV01 of 2.66. Multiply this value by a typical contract of 10mm gives us a value of 2666 ($/£/Euros)

DV01.zip (1.58 KB)

 

References

Credit Derivatives by Geoff Chaplin (Page 90) - link below

http://www.amazon.co.uk/exec/obidos/ASIN/047002416X/qid=1140112811/sr=8-1/ref=sr_8_xs_ap_i1_xgl/026-0058056-7028455

http://www.wilmottmag.com/messageview.cfm?catid=8&threadid=18242

Thursday, February 16, 2006 6:03:50 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback

I was adjusting a calculation for day-count convention and discovered

decimal dateAdjust = 365/360

does not equal

decimal dateAdjust = 365.0/360.0

Explanation here

http://sleeksoft.co.uk/public/techblog/articles/20050107_1.html

It reminded me of my VB days, when dividing by "\" is different from "/", and how rounding could sometimes give unexpected results

http://support.microsoft.com/?kbid=225330

On another note, I appreciate that a decimal type is a lot slower than a double but for accuracy I would've expected Math.Exp to take/return a decimal rather than a double.

Thursday, February 16, 2006 5:25:38 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Friday, February 10, 2006

http://msdn.microsoft.com/library/?url=/library/en-us/dnpag2/html/EntLib2.asp

Must confess that I never used the version for 1.1 as I couldn't see a reason to move on from the Data Access Application Blocks.

Friday, February 10, 2006 3:35:29 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Wednesday, February 08, 2006

25% less code - new features include

  • ASP.NET membership provider
  • Master pages
  • Generics

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bdasamppet4.asp

 |  |  | 
Wednesday, February 08, 2006 8:26:31 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Wednesday, January 25, 2006

The following 3 exams are in beta from Feb 13th to March 12th.

  • Upgrade MCAD to MCPD Windows Developer

http://www.microsoft.com/learning/mcp/mcpd/windev/

http://www.microsoft.com/learning/exams/70-552.asp  (promo code 552BTA)

  • Upgrade MCSD to MCPD Enterprise Application Developer

http://www.microsoft.com/learning/mcp/mcpd/entapp/

http://www.microsoft.com/learning/exams/70-553.asp (use promo code BTA553)

http://www.microsoft.com/learning/exams/70-554.asp (use promo code UPG554)

 

Register via Thomson Prometric

http://securereg3.prometric.com/

or Pearson VUE

http://www.vue.com/ms/

 | 
Wednesday, January 25, 2006 8:57:31 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Tuesday, January 17, 2006
 |  | 
Tuesday, January 17, 2006 1:35:31 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback

From Brad Abrams blog

http://blogs.msdn.com/brada/archive/2006/01/16/513018.aspx

Framework 2.0 may install, but MS won't support it.

This is relevant to me, as the team that I work in can't evaluate/migrate Framework 2.0/VS2005 until we know when the client plans on rolling out SP2 to the 1000's of desktop P.C.'s

Tuesday, January 17, 2006 12:32:10 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Monday, January 16, 2006

Had the latest quarterly update of the Action pack delivered. It now includes

  • SQL 2005 Standard edition
  • Visual Studio 2005 Express edition

You can get this free from here - MS have waived the first year free of $49.

http://msdn.microsoft.com/vstudio/express/support/faq/default.aspx#pricing

  • Visual Web Developer

http://msdn.microsoft.com/vstudio/express/vwd/

More details can be found here (when they get round to updating it!)

http://www.microsoft.com/uk/partner/sales_and_marketing/actionpack/contents.aspx

 |  | 
Monday, January 16, 2006 7:57:54 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Tuesday, January 10, 2006

This event is being held in London on the 6th Feb 2006. Registration cost £69 and all attendees get free Microsoft Software Package which includes SQL Server 2005 Standard Edition, Visual Studio 2005 Professional Edition and BizTalk Server 2006 Beta.

http://www.windowsitpro.com/roadshows/sqlservereurope/index.cfm?action=dynamic&v=5008&p=5043&code

Note that the website doesn't mention the software but the newsletter does

 |  | 
Tuesday, January 10, 2006 3:30:17 PM (GMT Standard Time, UTC+00:00)  #    Comments [2]  |  Trackback
Saturday, January 07, 2006

MS are doing some webcasts for the financial sector on 13-17th 2006

http://www.microsoft.com/events/series/msdndotnetunwrapped.mspx

http://www.financialdevelopers.com/

 | 
Saturday, January 07, 2006 9:39:40 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Tuesday, January 03, 2006

http://www.philweber.com/2006/01/02.htm#a148

Seems like MS are trying to ramp up rollout of VS2005 and VSTS.

We are currently using VS2003 and Clearcase and my client, although VS2005 and VSTS are being reviewed to see what benefits are available. I have talked before about buying VS2005 through my company via an MSDN subscription, but I couldn't justify paying for VSTS.

Tuesday, January 03, 2006 3:35:24 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Friday, December 16, 2005

Following from a comment on IsDbNull performance, I thought I would measure how the performance of IsDBNull.

http://weblogs.asp.net/justin_rogers/archive/2004/04/11/111151.aspx

Original test

This was the optimised access code from test 3 of the previous entry

http://www.noelwatson.com/blog/PermaLink,guid,e93c0b50-233e-47d9-b3cf-bfacf754af05.aspx

while (reader.Read()) 

{
     
     logDetails = (String)reader[0];
     logTime =(DateTime)reader[1];

}

taking around 8.3 seconds for 100 iterations

1. IsDbNull()

while (reader.Read()) 

{
     if (!reader.IsDBNull(0))
     {
      logDetails = (String)reader[0];
     }
     if (!reader.IsDBNull(1))
     {
      logTime =(DateTime)reader[1];
     }

}

The duration of the experiment has increased dramtically to over 13 seconds.

2. Comparing to System.DBNull.Value

while (reader.Read())
{
        if (reader[0]!=System.DBNull.Value)
      {
         logDetails = (String)reader[0];
     }
     if (reader[1]!=System.DBNull.Value)
     {
         logTime =(DateTime)reader[1];
     }
}


 

This test is quicker (approx 20%) and I think this is the 20% the article was referring to. However, as can be seen in the screendump, the number of calls to get_item has increased. Storing the value in a local variable will solve this

3. Storing result in local variable

while (reader.Read()) 

{
     detailsNullCheck = reader[0];
     if (detailsNullCheck!=System.DBNull.Value)
     {
         logDetails = (String)detailsNullCheck;
     }
     timeNullCheck = reader[1];
     if (timeNullCheck!=System.DBNull.Value)
     {
         logTime =(DateTime)timeNullCheck;
     }

}

 

This value is approximately the same as the original test in the previous entry - checking for null values should not be an overhead.

Friday, December 16, 2005 4:52:58 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback

After the last test looking at ways to improve slow data retrieval, I have decided to see what is the fastest method of pulling data from a SqlDataReader. This was driven from one of my colleagues claiming that the methods described in

 

http://www.sqljunkies.com/WebLog/amachanic/archive/2005/04/06/10462.aspx

 

were identical, and should not result in any performance difference.

 

The testing is similar to the last entry

 

http://www.noelwatson.com/blog/PermaLink,guid,366274e0-cbb0-4519-a039-6946e43d7bae.aspx

 

with the stored procedure from test 2 being used (read uncommitted and using clustered index seek). However, the loop will be executed 100 times rather than 20, and I will be testing against release rather than build mode. I didn’t build in release mode for the last round of testing as I knew that the greatest gains were to be found in the db layer.

I will be using reflector for .NET

 

http://www.aisto.com/roeder/dotnet/

 

to see what .NET is doing under the covers

1. This was the original test

 while (reader.Read())
   {
    logDetails = reader.GetString(0);
    logTime = reader.GetDateTime(1);
    
   }

As expected, the values for GetString are around 5 times the size (100 vs. 20 loops) of test 2in the previous entry

Looking at the Reflector code,

public string GetString(int i)
{
      SqlString text1 = this.GetSqlString(i);
      return text1.Value;
}

GetString() calls GetSqlString() internally.

2. Modify code to call SqlTypes directly

while (reader.Read())
   {
    logDetails = (string)reader.GetSqlString(0);
    logTime =(DateTime)reader.GetSqlDateTime(1);
   }

This is due to the op_explicit conversions

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatasqltypessqldatetimeclasssqldatetimetodatetimeconversiontopic.asp

Modifying the code to

 while (reader.Read())
   {
    logDetails = (SqlString)reader.GetSqlString(0);
    logTime =(SqlDateTime)reader.GetSqlDateTime(1);
   }

and declaring the variables as SqlTypes gives the following result, but you will still have to cast at some point unless you are happy passing SqlTypes around your system.

3. Method proposed in SqlJunkies link

while (reader.Read())
    {
     logDetails = (string)reader[0];
     logTime =(DateTime)reader[1];
    }

This is the quickest method if the second part of test 2 isn’t acceptable.

Friday, December 16, 2005 1:39:52 PM (GMT Standard Time, UTC+00:00)  #    Comments [1]  |  Trackback
Tuesday, December 13, 2005

Recently one of the developers was profiling an application to see where improvements could be made to the code. He was using  JetBrains profiler,

http://www.jetbrains.com/profiler/

and this was indicating that retrieving a string using from a SqlDataReader using reader.GetString() was taking a long time.

To recreate the problem, I firstly populated a similar database – the script in the previous entry is sufficient.

http://www.noelwatson.com/blog/PermaLink,guid,b8d1d44e-0058-43d7-8635-25513e9bc86e.aspx

although you will have to add an extra zero to the loop – 1 million records wasn’t enough to recreate the problem.

DECLARE @DateSubtract DECIMAL(9,4)
DECLARE @Counter INT

SELECT @Counter = 0

WHILE @Counter < 10000000
BEGIN
 SELECT @DateSubtract = RAND() * 100000
 INSERT INTO LOG (LogDateTime, Details)
 VALUES (DATEADD(mi, - @DateSubtract, GETDATE()), 'TEST')
 SELECT @Counter = @Counter + 1
END

A simplified version of the stored procedure is shown below

ALTER        PROCEDURE p_LogSearch_s
(
@ip_StartDate DATETIME,
@ip_EndDate DATETIME
)

AS


SELECT  Details, LogDateTime FROM LOG
WHERE (@ip_StartDate IS NULL OR LogDateTime >= @ip_StartDate) AND (@ip_EndDate IS NULL OR LogDateTime < @ip_EndDate)

Test code is shown below. This is called 20 times

private void RetrieveData()
  {
   SqlConnection sqlConn = null;
   SqlCommand sqlCmd = null;
   SqlDataReader reader = null;
   SqlParameter param = null;
   string strSqlConn;
   string logDetails;
   DateTime logTime;
  
    strSqlConn = @"Data Source=(local); Initial Catalog=Log;Integrated Security=SSPI";
    sqlConn = new SqlConnection(strSqlConn);
    sqlCmd = new SqlCommand();


    sqlConn.Open();

    sqlCmd.CommandText = "p_LogSearch_s";
    sqlCmd.CommandType = CommandType.StoredProcedure;
    sqlCmd.Connection = sqlConn;

    param = new SqlParameter("@ip_StartDate",SqlDbType.SmallDateTime);
    param.Value  = new DateTime(2005,12,7,21,30,0,0);
    sqlCmd.Parameters.Add(param);
    param = new SqlParameter("@ip_EndDate",SqlDbType.SmallDateTime);
    param.Value = new DateTime(2005,12,8);
    sqlCmd.Parameters.Add(param);
   
    
    reader = sqlCmd.ExecuteReader();

    while (reader.Read())
    {
     logDetails = reader.GetString(0);
     logTime = reader.GetDateTime(1);
     
    }
  }

We are retrieving 2.5 hours worth of data - 15161 rows


Looking at the results, it is interesting to see that GetString() takes almost 20 times as long as GetDate(). However, this is because GetString() is the first call to retrieve the next row of the data, so will take longer and is a red herring. If we were to swap GetDateTime() above GetString(), the orders would reverse. 303220 is the number of hits we are expecting (20 iterations * 15161 rows), the Read method reads the extra time when the end of the recordset is reached.

Note that some of the calls (e.g FPushMessageLoop) can be ignored as they are related to form population

Solutions

1. Modify Isolation level

One way to improve performance is to set the isolation level to read uncommitted – this is acceptable when reading log data as we are not too fussed if the occasional record is uncommitted. This improves performance by around 20%, although gives an even more misleading result in JetBrains!

2. Modify the stored procedure

The stored procedure can be rewritten

ALTER         PROCEDURE p_LogSearch_s
(
@ip_StartDate DATETIME,
@ip_EndDate DATETIME
)

AS

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SELECT  Details, LogDateTime FROM LOG
WHERE (LogDateTime >= @ip_StartDate) AND (LogDateTime < @ip_EndDate)

and the results are dramatic

However, this stored procedure as it stands may be unacceptable as it may be the case that null variables must be passed to the stored procedure.

3. Improve performance reading from the datareader

With reference to the following link

http://www.sqljunkies.com/WebLog/amachanic/archive/2005/04/06/10462.aspx

it is possible to improve performance when accessing the datareader

while (reader.Read())
    {
     logDetails = reader.GetString(0);
     logTime =reader.GetDateTime(1);
    }

becomes

while (reader.Read())
    {
     logDetails = (string)reader[0];
     logTime =(DateTime)reader[1];
    }

 

This improves performance marginally, get_item taking 59064ms is less than the combined total of GetString (58803ms) and GetDateTime (389ms) in test 1 (UNCOMMITTED).

4. Use a dataset

I did this just out of interest, as I didn't believe performance would be improved

while (reader.Read())
    {
     logDetails = reader.GetString(0);
     logTime =reader.GetDateTime(1);
    }

becomes

DataSet ds = new DataSet();
   SqlDataAdapter da;
   da = new SqlDataAdapter(sqlCmd);
   
   da.Fill(ds);
   foreach(DataRow dr in ds.Tables[0].Rows)
   {
    logDetails = (string)dr[0];
    logTime =(DateTime)dr[1];

   }

 

65312 milliseconds compares favourably with test 1, (note that in the real world, I wouldn't iterate through the dataset but instead would bind directly to a grid) which has

GetString           58803

Read                 3825

ExecuteReader   1398

GetDateTime      389

=64415ms

Dataset vs. DataReaders can be found here

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bdadotnetarch031.asp

Conclusion

Modifying the stored procedure would be the obvious choice. Using code such as

(@ip_StartDate IS NULL OR LogDateTime >= @ip_StartDate)

Doesn’t allow the index to be used correctly (uses a scan rather than a seek)

An alternative is to use a parent stored procedure, and call individual child stored procedures dependant on the parameters passed to the parent sp. Maintaining these can be a headache, but are necessary if performance is critical.

 

 

 |  | 
Tuesday, December 13, 2005 11:12:24 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Wednesday, November 30, 2005

http://msdn.microsoft.com/vstudio/express/vwd/download/

They are even offering 3 months free ASP.NET 2.0 web hosting

 | 
Wednesday, November 30, 2005 8:54:19 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
Monday, October 31, 2005

Coinciding with the release of next generation SQL and Visual Studio, Microsoft have released three new certifications

http://www.microsoft.com/learning/mcp/newgen/

 

This requires one or two exams - similar to passing one exam to attain MCP

  • Technology Specialist: .NET Framework 2.0 Web Applications
  • Technology Specialist: .NET Framework 2.0 Windows Applications
  • Technology Specialist: .NET Framework 2.0 Distributed Applications
  • Technology Specialist: SQL Server 2005
  • Technology Specialist: BizTalk Server 2006

    The professional qualifications will require renewal every three years.

  • IT Professional: Database Developer
  •          The database administrator has an upgrade path from an exisiting MCDBA

  • IT Professional: Database Administrator
  • IT Professional: Business Intelligence Developer
  •  Similar to MCSD - I wonder how much overlap the windows and web tracks will have - there was a lot for the MCSD.NET

  • Professional Developer: Web Developer
  • Professional Developer: Windows Developer

    These first two appear to be MCAD equivalent - the following has the ability to upgrade from an existing MCSD.NET (available next summer)

  • Professional Developer: Enterprise Applications Developer
  • MS area also offering e-learning courses until 1st November 2006 - a SQL example is listed below.

    https://www.microsoftelearning.com/sqlserver2005/

    It appears that the old certifications (MCSD, MCDBA) will continue for a while longer. It will be interesting to see if the exams are interactive rather than multi-choice, and when Transcender release test products. I think I will do the MCSD and MCDBA upgrade exams late in 2006.

    For those that don't like book studying, the following might be worth looking at.

    http://www.londonmet.ac.uk/depts/cctm/microsoft/

    I covered the architecture qualification in a previous post (apparently it will cost $10000 to apply)

    http://www.noelwatson.com/blog/PermaLink,guid,edbfa0d1-7cb6-40bc-ba2f-a880f05a03fd.aspx

    It would appear that the SQL beta exams are imminent - you can sign up here

    http://www.zoomerang.com/recipient/survey-intro.zgi?p=WEB224MR5DUMAT

    I was of the understanding that beta invitations were sent out on the MCPFlash newsletter - obviously not!

     |  | 
    Monday, October 31, 2005 2:50:41 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Friday, October 28, 2005

    VS2005 and SQL2005 are available to download for MSDN subsribers

    http://msdn.microsoft.com/subscriptions/

    .Net Framework 2.0 is available here

    http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&DisplayLang=en

     | 
    Friday, October 28, 2005 10:11:31 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Wednesday, October 19, 2005

    Stumbled across the following link

    http://www.roadtowinfx.com/default.aspx

    Also recommends a WinFX book

    http://www.amazon.co.uk/exec/obidos/tg/detail/-/0596101139/qid=1128771463/sr=8-14/ref=sr_8_xs_ap_i13_xgl14/026-1408501-5707662?v=glance&s=books&n=507846

    has been given good reviews on the UK and US site so have placed an order.

     | 
    Wednesday, October 19, 2005 10:11:01 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Wednesday, October 12, 2005

    Following on from a previous entry

    http://www.noelwatson.com/blog/PermaLink,guid,9cc83579-486f-4817-a95d-549691dab361.aspx

    My Action Pack

    http://www.microsoft.com/uk/partner/sales_and_marketing/actionpack/

    is up for renewal soon, so I am looking into the best way of getting the software I need. As I'm now self employed, this is a business expense so I'm looking at getting an MSDN subscription.

    Looking at the 5 different levels, it would appear Professional is the minimum required to get a copy of Studio.

    http://msdn.microsoft.com/howtobuy/subscribers/compare/

    This retails at $1199

    http://msdn.microsoft.com/howtobuy/subscribers/

    There are savings to be made going with Open Licensing

    http://blogs.msdn.com/mssmallbiz/archive/2005/01/06/347470.aspx

    http://www.greymatter.com/Developers/Microsoft/Home.asp#open

    Moving onto VS2005, I've not discovered whether the open license agreement applies

    http://msdn.microsoft.com/howtobuy/vs2005/subscriptions/default.aspx

    All but the top level of MSDN comes without Office software, so it may be worth continuing with the Direct Access pack (at £199).

     

    Wednesday, October 12, 2005 5:25:20 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Wednesday, September 28, 2005

    http://www.microsoft.com/uk/windowsserversystem/launchtour/default.mspx

    Might be worth going for a freebie or two - I went to one a few a years ago and got a copy of VS2002.

     

     |  | 
    Wednesday, September 28, 2005 7:38:02 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Tuesday, September 27, 2005

    Actually, they've ben out for almost a fortnight now, but I've been a little busy at work. SQL can be downloaded by all

    http://www.microsoft.com/sql/2005/productinfo/ctp.mspx

    whereas VS2005 requires an MSDN subscription

    http://msdn.microsoft.com/subscriptions/

    I'm probably going to wait until the release comes out on the 7th November before upgrading from Beta2.

     |  | 
    Tuesday, September 27, 2005 8:01:08 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Thursday, July 28, 2005

    Listed below are some of the work related books I have read, newest to oldest, over the last couple of years.

    .NET

    • Effective C#

    http://www.amazon.co.uk/exec/obidos/ASIN/0321245660/qid=1122547865/sr=8-1/ref=sr_8_xs_ap_i1_xgl/202-1389977-0403848

    I bought this one from after a recommendation from a colleague. Managed to read within a day and learnt a few things, such as CLSCompliant attribute

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemCLSCompliantAttributeClassTopic.asp

    • Customising the Microsoft .NET framework

    http://www.amazon.co.uk/exec/obidos/ASIN/0735619883/qid=1122548063/sr=1-1/ref=sr_1_18_1/202-1389977-0403848

    Not managed to read yet as other books have seemed more tempting

    • Patterns of Enterprise Application Architecture

    http://www.amazon.co.uk/exec/obidos/ASIN/0321127420/qid=1122548175/sr=1-1/ref=sr_1_3_1/202-1389977-0403848

    A good read - helps you focus on reuse of code through identifying common problems and implmementing patterns.

    • .NET Remoting

    http://www.amazon.co.uk/exec/obidos/ASIN/0735617783/qid=1122549105/sr=2-3/ref=sr_2_3_3/202-1389977-0403848

    Not that impressed. Maybe the book came out too early, but doesn't seem to follow best practice and isn't a patch on Rammer.

    • Advanced .NET Remoting

    http://www.amazon.co.uk/exec/obidos/ASIN/1590594177/qid=1122549105/sr=2-1/ref=sr_2_3_1/202-1389977-0403848

    The remoting bible. Contains the vast majority of information you need on remoting. I have used code (encryption) from here in a production system. Supported by an excellent website.

    http://www.thinktecture.com/

    • .NET Components

    http://www.amazon.co.uk/exec/obidos/ASIN/0596003471/qid=1122549335/sr=1-8/ref=sr_1_3_8/202-1389977-0403848

    Read in conjunction with another O'Reilly C# book, Programming C#. Has been updated with 2.0 info

    http://www.amazon.co.uk/exec/obidos/ASIN/0596007620/qid=1122549335/sr=2-1/ref=sr_2_3_1/202-1389977-0403848

    • Programming C#

    http://www.amazon.co.uk/exec/obidos/ASIN/0596006993/qid=1122549565/sr=2-3/ref=sr_2_3_3/202-1389977-0403848

    A good introduction to C# and if you are a complete beginner, it may be worth reading the introduction book first

    http://www.amazon.co.uk/exec/obidos/ASIN/0596003765/ref=pd_sim_b_dp_3/202-1389977-0403848

    • Applied Microsoft .NET Framework Programming

    http://www.amazon.co.uk/exec/obidos/ASIN/0735614229/qid=1122549739/sr=2-1/ref=sr_2_3_1/202-1389977-0403848

    The .NET bible. This should be on every .NET developers bookshelf.

    Finance

    • Fixed Income Mathematics

    http://www.amazon.co.uk/exec/obidos/ASIN/0786311215/qid=1122550071/sr=1-1/ref=sr_1_2_1/202-1389977-0403848

    This book helps understand bond pricing calculations because it contains lots of examples with numbers. It is then easy to use the examples in code to arrive at the same result

    • Paul Wilmott Introduces Quantitive Finance

    http://www.amazon.co.uk/exec/obidos/ASIN/0471498629/qid=1122549959/sr=8-2/ref=sr_8_xs_ap_i2_xgl/202-1389977-0403848

    Really easy to read - good introduction. Recommends the Fabozzi book in Chapter 14.

     |  | 
    Thursday, July 28, 2005 11:26:14 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Thursday, June 30, 2005

    I remember having this problem when upgrading from Studio 2002/Framework 1.0 to Studio 2003/Framework 1.1. All of a sudden, our decimal types no longer had the trailing zeros removed when populating values from a database.

    I'd forgotten how I originally fixed this, so my first attempt this time was

    dr.GetDecimal(1).ToString().Trim('0')

    Unfortunately, this doesn't work as a 0 value will be effectively set to a zero length string. Further investigation led me to the following site

    http://blogs.msdn.com/bclteam/archive/2004/06/01/145468.aspx

    The answer is

    dr.GetDecimal(1).ToString("G29")

     

    Thursday, June 30, 2005 7:59:13 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Wednesday, June 22, 2005
    Small titbits covering MS technology
     |  | 
    Wednesday, June 22, 2005 3:44:52 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Tuesday, June 21, 2005
    Haven't got the hardware to play with the new Microsoft toys?
     |  | 
    Tuesday, June 21, 2005 5:42:10 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Friday, June 17, 2005
    Useful reference
     |  | 
    Friday, June 17, 2005 5:43:04 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Framework 1.1 SP1 on Win 2003 machine
    Friday, June 17, 2005 8:04:15 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Monday, April 11, 2005
    Difficulties with using more than one channel with same protocol
    Monday, April 11, 2005 3:11:34 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Wednesday, March 30, 2005
    Problem solved
    Wednesday, March 30, 2005 10:08:57 AM (GMT Standard Time, UTC+00:00)  #    Comments [2]  |  Trackback
    Thursday, March 24, 2005
    New functionality with .NET Framework v2.0
    Thursday, March 24, 2005 10:05:43 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Friday, March 04, 2005
    Shouldn't this be easy?
    Friday, March 04, 2005 4:50:26 PM (GMT Standard Time, UTC+00:00)  #    Comments [55]  |  Trackback
    Installation woes
     | 
    Friday, March 04, 2005 2:24:06 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |  Trackback
    Thursday, March 03, 2005
    Receive strange error message when a SqlException is thrown
    Thursday, March 03, 2005 4:11:53 PM (GMT Standard Time, UTC+00:00)  #    Comments [1]  |  Trackback

    Theme design by Jelle Druyts

    Pick a theme: