Greg 的个人资料Greg Olsen - Yellow Duck...照片日志列表 工具 帮助

日志


3月8日

Internet Explorer 8 - Approx. Mix 07 April 30 - May 2

Currently, Microsoft is gathering input from Tech Beta participants via an IE 8 features survey and will unveil the browser at MIX 07 between April 30 and May 2.

Microsoft Technical Briefing 2007 - My Notes now available

If you would like a real high-level notes of the sessions I went to today then you can download them.
 
 
Files available here are (Office 2007 files):
  • Information Worker Track - Session 3 - SharePoint Deployment.docx
  • Information Worker Track - Session 4 - Developers Overview of SharePoint 2007.docx
  • Infrastructure Track - Session 1 - Vista Deployment.docx
  • Infrastructure Track - Session 2 - Enterprise Search.docx

Enjoy!

Yellow Duck Guy
Greg Olsen

 
3月7日

Technical Briefing

I attended the Microsoft 2007 Technical Briefing today. I'm sorting out internet storage space for my blog and then i can update my blog with my notes from today.
 
WATCH THIS SPACE!
 
Yellow Duck Guy
Greg Olsen
2月26日

SQL Server 2005 Service Pack 1

Microsoft SQL Server 2005 Service Pack 1 (SP1) adds Database Mirroring, SQL Server Management Studio Express, additional options for ISVs and normal feature fixes.
 
More information, see the Microsoft site here:

Microsoft is gearing up for Vista Service Pack 1

Microsoft is gearing up for Vista Service Pack 1 to be released, no date confirmed as yet
 
"We expect Windows Vista SP1 to be a standard service pack that will include security updates and hot fixes, as well as limited other changes focused on improving overall quality" (CNet News, 2007).
12月11日

Return total row number for each table in database with SQL Server 2005

Using SQL Server 2005 and a bit of good old T-SQL you can obtain the row count for all tables in your database with this handy piece of code ...

SELECT    object_id,

          OBJECT_NAME(object_id)  AS  ObjectName,

          SUM (row_count)         AS  RowCnt

FROM      sys.dm_db_partition_stats

WHERE     index_id  <  2

AND       OBJECTPROPERTY(object_id, 'IsUserTable')  =  1

GROUP BY  object_id

 

Thanks to Ferry Nugraha for this code!

12月9日

System.TransactionScope with Unit Testing for both NUnit & Visual Studio Unit Testing

One good thing about using System.Transactions with a unit test is the ability to perform a database unit test which then performs a rollback once the test is completed.

(1) To create a unit test for NUnit with database rollback, simply add a 'using' statement similar to the example below.

Note: you need to add a reference to your project to the System.Transactions namespace. Then add 'using System.Transactions;' to your class (.cs) file. You will also need the NUnit.Framework dll added as a project reference and also 'using NUnit.Framework;' to your class (.cs)

   1:  [Test]
   2:          public void BlogInsert()
   3:          {           
   4:              using (TransactionScope scope = new TransactionScope()) 
   5:              {
   6:                  DateTime postedDate = new DateTime(2006, 11, 23);
   7:                  string title = "XML Notepad 2006";
   8:                  string contents = "this is the contents from the blog";
   9:                  string blogUrl = "http://yellowduckguy.spaces.live.com/";
  10:   
  11:                  int expectedRowsAffected = 1;
  12:                  int actualRowsAffected = BlogDataAccess.BlogAdapterInsert(postedDate, title, contents, blogUrl);
  13:   
  14:                  Assert.AreEqual(expectedRowsAffected, actualRowsAffected);
  15:              }
  16:          }
 

The key lines in the above code is line 4. This is where we add the 'using (TransactionScope ....' statement in order to wrap the statement into a transaction and allow the code to rollback against the database (I have been using this against SQL Server Database).

(2) To create a unit test for Visual Studio with database rollback, simply change the the unit test attribute from [Test] to [TestMethod] and make sure you have reference to 'using Microsoft.VisualStudio.TestTools.UnitTesting;'

   1:          [TestMethod]
   2:          public void BlogInsert()
   3:          {           
   4:              using (TransactionScope scope = new TransactionScope()) 
   5:              {
   6:                  DateTime postedDate = new DateTime(2006, 11, 23);
   7:                  string title = "XML Notepad 2006";
   8:                  string contents = "this is the contents from the blog";
   9:                  string blogUrl = "http://yellowduckguy.spaces.live.com/";
  10:   
  11:                  int expectedRowsAffected = 1;
  12:                  int actualRowsAffected = BlogDataAccess.BlogAdapterInsert(postedDate, title, contents, blogUrl);
  13:   
  14:                  Assert.AreEqual(expectedRowsAffected, actualRowsAffected);
  15:              }
  16:          }
11月18日

Error while trying to run project: unable to start debugging on the web server

One option to check for this error (with now Internet Explorer 7 installed) is to check the the Local Intranet settings.
 
Add the server to the Local intranet or Trusted sites zone. 
 
To do this: 
With Internet Explorer, choose Internet Options from the Tools menu.
In the Internet Options dialog box, choose the Security tab.
Click Local Intranet, then click Sites. 
Click Advanced.
In the Add this Web Site to the zone box, enter the URL of the project, click Add, then click OK.
10月19日

Unrecognized attribute 'xmlns'

Normal issue is due to the wrong IIS setting for the application framework build. Read on for more ...
 
Resolution:
Make sure you have the Application Pool in IIS set to run only .NET 2.0 applications and the ASP.NET tab in IIS is set to use the .NET 2.0 Framework.  I always create a Application Pool in IIS called .NET 2.0 and assign my .NET 2.0 web applications to run under that pool and for .NET 1.1 applications then I create a .NET 1.1 Application Pool. Obviously you could create more pools if required.
 
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
 
Parser Error Message: Unrecognized attribute 'xmlns'.
 
 

Server Error in '/' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized attribute 'xmlns'.

Source Error:

Line 8:      \Windows\Microsoft.Net\Framework\v2.x\Config 
Line 9:  -->
Line 10: <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
Line 11: 	<appSettings/>
Line 12: 	<connectionStrings>

Source File: D:\IIS Sites LIVE\DocumentLibraryWebService\web.config    Line: 10


Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
 
 
Yellow Duck Guy
Greg Olsen

Internet Explorer Version 7 Now Released

Internet Explorer 7 hows now been released by Microsoft to the public for use.
 
Check out the new easier to use and more secure web browser here:
 
Currently supported operating systems for Internet Explorer 7
Windows XP Service Pack 2 (SP2)
Windows XP Pro x64 Edition
Windows Server 2003 x64 Edition
Windows Server 2003 Service Pack 1 (SP1)
Windows Server 2003 ia64 Edition
 
Yellow Duck Guy
Greg Olsen 
10月13日

Generics - Create List & ToArray C#

Generics is new namespace within the .NET 2.0 Framework which i'm sure you all will start using at some point on a project or solving a problem.
 
Now some code examples for you (in C#):

To add the namespace to your class, simply add the using statement below:
using System.Collections.Generic;
 
To create a simple string generic list:
List<string> stringList = new List<string>();
 
Then to add a string to the list, simply do the following:
string helloMessage = "hello welcome to Generics";
stringList.Add(helloMessage)
OR
stringList.Add("hello welcome to Generics")

Then to add to an array of objects (in this example strings) then use the 'ToArray' method as follows:
string[] arrayOfStrings = stringList.ToArray();
 

XML Notepad 2006 Download

You can now download XML Notepad 2006.
 
Get from Microsoft here:
 
Can be quite a good tool if you use XML a lot. Be keen to know your comments on it!
 
Yellow Duck Guy
Greg Olsen
10月6日

Exchange 2007 - Send Connector Error

A matching connector cannot be found to route the external recipient

Ever had a problem sending email using the new and cool Exchange 2007 with a current send connector? Then this may help you.
 
My Error:
"A matching connector cannot be found to route the external recipient"

My Resolution:
I found that The Hub Transport section had an error with the "Send Connector" I had set up. I had the Address Space set to the machine ip address .. dol! seems a developer's logical first step

Goto: Organisation > Hub Transport > Send Connector "Tab" > Address Space "Tab" -Change this to * (asterisk)

You could also do this via the new command line shell for Exchange 2007 by typing:
Set-SendConnector "<specify send connector name here>" AddressSpaces: "*"

Hope this helps you!