Blog Home  Home Feed your aggregator (RSS 2.0)  
My DasBlog! - Wednesday, May 18, 2005
newtelligence powered
 
# Wednesday, May 18, 2005

At Rob Howard's blog we can read that CodeSmith 3.0 has been released since Monday May 16th. I agree with him that using code generation tools can save enormous time and prevents common mistakes by writing the same code over and over again.

"Code generation tools represent one of the most interesting areas where a tremendous amount of innovation opportunity still exists for improving the software development process. By automating the process of creating framework, database access, or other common/repeated code patters developers can save time, companies can save money, and users of the end product will get better solutions. Why? Instead of spending hours repeating the same logic flows, data access layers, or implementation frameworks just write it once as a CodeSmith template. That's right -- using .NET code you can write a template for how you want your code to be generated. It's still your code with your formatting your comments and your style -- CodeSmith just helps you write it faster. In fact, you could say it's like hiring your own personal army of developers!"

You can download a free 30 day trial version.

http://weblogs.asp.net/rhoward/archive/2005/05/17/407197.aspx

Wednesday, May 18, 2005 7:40:52 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   .NET | C#  | 
Adam Machanic has posted a month ago an article about SqlDataReader performance tips. One about using an indexer with the ordinal position, a second one about avoiding the Get methods and a third about opening and closing the reader.

Especially the last one is something we all sometimes forget. Thanks to Adam for these tips! :)
Wednesday, May 18, 2005 7:30:09 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   C# | Databases  | 
# Tuesday, May 17, 2005

Passing a null value to an int is not possible. The int type is mapped to the System.Int32 structure type and is not capable of storing a null value. Only integer values can be stored in there.

There are two ways which i know of how to solve this problem. The first method is using an object in stead of the int type. For example:

object val = 200;

if (val != null)
{
   return (int)val;
}

In this way you can set the val variable to a null value or an integer value. In case of an integer value you unbox the value to retrieve the integer value.

A second method is using the SqlInt32 type found in namespace System.Data.SqlTypes which is a SQL type. This type supports nullable values. For example:

SqlInt32 val = SqlInt32.Null;

or

SqlInt32 val = 200;

Tuesday, May 17, 2005 10:42:58 AM (GMT Daylight Time, UTC+01:00)  #    Comments [2]   C# | SQL Server  | 

The following link was found when i googled looking for a character entity reference for HTML. It gives you a long list of character formats and their equvalents in HTML like for example:

["] quotation mark
         [name: "] [number: "]

[®] registered trademark 
         [name: ®] [number: ®]

[ ] en space 
         [name:  ] [number:  ]

http://www.bigbaer.com/reference/character_entity_reference.htm

Tuesday, May 17, 2005 9:01:26 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   HTML  | 
# Friday, May 13, 2005

Arphan Shah pointed out on his blog a nice tip about implementing your own Recycle Bin in Windows SharePoint Services. The article at his blog contained a link to Microsoft which describes a guidance on how you can implement your own SharePoint Recycle Bin.

Follow the link below:

Add a Recycle Bin to Windows SharePoint Services for Easy Document Recovery

Friday, May 13, 2005 3:50:18 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SharePoint  | 
# Thursday, May 12, 2005

A really cool web part which makes it possible to create a Wikipedia-like application in SharePoint Portal Server or Windows SharePoint Services is made by Mart Muller. It is still in beta but very very promising. :)

http://blogs.tamtam.nl/mart/TamTamWikiSharePointBeta1ForWSSAndSPS.aspx

Thursday, May 12, 2005 4:27:08 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SharePoint  | 
Packaging and deploying a web part is not that easy but it looks nice and cool when you send your customer a MSI (Microsoft Self Installer) file. This article describes in a few steps what you have to do to create a MSI file. For more information i refer to the link at the bottom of this post which explains more in detail...

Thursday, May 12, 2005 1:11:41 PM (GMT Daylight Time, UTC+01:00)  #    Comments [7]   SharePoint  | 
This is a very simple example how to transform a Webform.aspx file to a wizard. It contains two buttons and works even when the back and next button of the browser are used...
Thursday, May 12, 2005 12:53:22 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   ASP.NET | C#  | 
# Wednesday, May 11, 2005
If you want to use functionality like SPControl.GetContextWeb(Context).Lists and your trust level is set to WSS_Minimum the code will throw an System.Security.Exception telling you that:

Request for the permission of type Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c failed

This means that the code is partial trusted. Normally if you install your assembly in the GAC it runs with "Full" trust. Microsoft recommends that you install your web part assemblies in the BIN directory for a more secure deployment. Therefor the code becomes partial trusted and some functionality is prohibited by the CAS (Code Access Security) and the trust level set in the web.config...
Wednesday, May 11, 2005 3:14:04 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   C# | SharePoint  | 

Sometimes you decide to move a created Web Part to another namespace in another assembly. Whenever you do that the Web Part from the first assembly will still show up in the "Virtual Server Gallery" even if it is not present anymore in that assembly.

Solution
Go to the folder "wpcatalog" under your SharePoint web folder and there you will find a list with all dwp files from the "Virtual Server Gallery". Remove the old dwp file and refresh your browser. The Web Part will not show up anymore.

Thanks to my colleague Mart Muller for this simple solution :)

Wednesday, May 11, 2005 12:55:45 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SharePoint  | 
Copyright © 2012 Alexander Meijers. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: