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];
 &