Wednesday, September 7, 2005

What is System.DBNull.Value used for?

Q: What is System.DBNull.Value used for?



A: System.DBNull.Value is the value of NULL retrieved from a DB. Before assigning a database field to a variable, you should always check to see if the value returned from the DB is NOT null. Otherwise, an exception could be thrown.



Example:

If Not drPkgRec("MeetDate") Is System.DBNull.Value Then

Dim strMeetingPlace = drPkgRec("MeetPlace")

End If



Note: The Keyword "Is" is used, not "=".



Tuesday, September 6, 2005

Database Mirroring in SQL Server 2005

I came across an article on TechNet about Database Mirroring. This is an in-depth article that should cover all the details (i.e. what is it, how to use it, etc). http://www.microsoft.com/technet/prodtechnol/sql/2005/dbmirror.mspx

Friday, September 2, 2005

The identifier that starts with "SELECT * FROM ...." is too long. Maximum length is 128.

This morning as I was working on a project, I tested a SQL statement in Query Analyzer, but got the following error:

Server: Msg 103, Level 15, State 7, Line 1The identifier that starts with "SELECT * FROM ...." is too long. Maximum length is 128.

After searching on the internet, I found a solution at http://support.microsoft.com/default.aspx?scid=kb;EN-US;294839. Microsoft recommends installing SP1 to resolve this and it worked.

Microsoft Office SharePoint Portal Server 2003 Discovery Kit

The SharePoint Portal Server 2003 Discovery Kit includes a series of discovery labs that go beyond learning about a particular component of SharePoint Portal Server 2003 to understanding how to build a divisional portal site solution, how to deploy Web applications that integrate tightly with the portal site environment, how to use SQL Server 2000 Reporting Services to track and analyze portal site usage, and lastly, how to customize the portal site user interface.

There are 6 labs in the SharePoint Portal Server 2003 Discovery Kit. The lab manuals includes a description of the business scenario that is addressed by the lab, the teaching objectives of the lab, step-by-step instructions, dependencies for each lab and the expected amount of time needed for the lab assuming a basic familiarity with Windows SharePoint Services and limited SharePoint Portal Server 2003 experience.

http://www.microsoft.com/downloads/details.aspx?familyid=03607516-cbec-4724-b4a4-aa7f09304ba5&displaylang=en

Thanks to Steve Luper (Microsoft) for the info.

Tuesday, August 30, 2005

Questions from the August 2005 SIG Meeting

Listed below are the answers to some of the questions posed at the August SIG meeting about SharePoint 2003.

Q: For a web part that displays Outlook contacts in a SharePoint site, will it require Exchange?
A: If you use "My Inbox" and tweak it a bit to point to any mail folder in your Exchange mailbox. (e.g. https://exchange.mycompany.com/exchange/1602/contacts/) In this case,
it does require Exchange. On the other hand, there are special list types called Contacts Lists built-in to SharePoint. These are not integrated directly with Outlook. The data sits in the SharePoint SQL database. However, there is an option to "Link to Outlook". This gives you a link to the SharePoint Contacts list from your Outlook client. You can also import contacts from Outlook into the SharePoint contact list. In both cases, Exchange is probably not required, but this has not been tested.


Q: How do you deploy an application from QA to production?
A: First, build a CAB file to contain assemblies(.DLL), content files(.XML, .DWP), etc. Second, use STSADM.EXE in WSS to backup an existing site, if needed. For more information on STSADM.EXE see http://support.microsoft.com/?kbid=889236. Third, unzip the CAB file to install all the required files on the SharePoint server.


Q: Are there any issues with installing VS.Net Team systems and SharePoint 2003 on the same machine?
A: As of now, VS.Net Team Systems is available only in a beta version, and anytime a beta version is installed, issues maybe encountered such as ...
http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=9dd6ab39-625c-46bb-bc88-973b268973d7
VS.Net 2005 Team System requires SharePoint, and the installation notes that come with it explain how to do this. If you’re doing a clean install you will need to install SharePoint with the MSDE database, because SharePoint doesn’t work with SQL 2005 yet. The SQL 2005 DB and MSDE can coexist, because MSDE is installed to a different instance.
If you’re going to install VS.Net 2005 on an existing system with SharePoint, you need to make sure the SQL 2005 install doesn’t update the existing SQL 2000 environment.

Thanks to Nate B. and other members of the Berbee team for helping answer some of these questions.

Friday, August 26, 2005

Visual Studio .Net has detected that the specified web server is not running asp.net version 1.1, You will be unable to run ASP.Net Web Applications

Problem: If you start Visual Studio .Net 2003 and get the following error:

"Visual Studio .Net has detected that the specified web server is not running asp.net version 1.1, You will be unable to run ASP.Net Web Applications or services"

There are several ways to go about fixing this error.

Solution:
From "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322", run "aspnet_regiis.exe -r". The following messages will appear

Start replacing ASP.NET DLL in all Scriptmaps with current version (1.1.4322.0).
Finished replacing ASP.NET DLL in all Scriptmaps with current version (1.1.4322.0).


When execution has completed, you can start VS.Net and load a web application without any problems.

Wednesday, August 24, 2005

Passing variables to a web page in .Net

To pass a variable from one web page to another page, use Response.Redirect() method(Response.Redirect("newpage.aspx?variablex=newvalue")) to pass a variable to a newpage.aspx.

In the receiving page (newpage.aspx), use the Request.QueryString() function to extract the variable desired (Dim strPassed As String = Request.QueryString("variablex")). When executed, the value of strPassed will be "newvalue".

Tuesday, August 23, 2005

Authenticating web app users against Active Directory

I found a great article (http://support.microsoft.com/kb/326340) on microsoft.com that provides click-by-click instructions on how to authenticate users logging into a web application against Active Directory.

The article is complete and easy to understand, but misses to mention 2 crucial points. Within Login.aspx, you need to specify "Imports MyApp.FormsAuth". This will import the FormsAuthAD Namespace, otherwise declaring a variable of type "LDAPAuthentication" will result in a compile time error.

Also, if you cut & paste the code, be sure that any references to "FormsAuthAD" are changed to the name of your project. This will ensure you import the correct class from the correct assembly. Aside from these points, the article is nicely written and easy to understand.

Monday, August 22, 2005

Storing a time zone value in SQL Server's datetime field

Q: Is there a way to store the time zone value in a datetime field in SQL Server? I receive the value of ‘12/1/2005 12:31:23 -5:00’ and when I try to store it in SQL it fails. Do I need to format the date/time differently, or I am forced to create a separate time zone field?

A: SQL Server does not support storing a timezone in a datetime field. However, to overcome that issue, you can convert all date/time values to the UTC timezone so you have a standard timezone to work with. When displaying the data to the user, you would then convert the time to the client’s timezone.

In regards to storing the value ‘12/1/2005 12:31:23 -5:00’ into SQL Server, try using the format '2005-08-09 00:00:00.000'.

LibCheck.exe

LibCheck.exe is a free utility from Microsoft that allows you to compare two versions of an assembly, and determine the differences. The tool reports the differences as a combination of 'removed' and 'added' APIs. This can be useful in resolving versioning issues and determining which libraries are needed for a particular application.

For more information or to download LibCheck, go to http://www.microsoft.com/downloads/details.aspx?familyid=4B5B7F29-1939-4E5B-A780-70E887964165&displaylang=en

Friday, August 19, 2005

Building a Smarter Home with .Net

I came across an interesting article on MSDN (http://msdn.microsoft.com/coding4fun/diy/usingx10/default.aspx) that turns an ordinary home into a smart home. Using an X10 device, one can turn on/off lights and devices remotely. In addition the X10 device can be interfaced with a PC and controlled using PERL script or .Net code. This also means you can control devices in your home through a VPN connection or a simple email. The MSDN article also contains a 15 mintue how-to video that shows the X10 in action.

To take it a step further and interface with .Net code, Tony Northrup wrote "Home Hacking Projects for Geeks" (http://www.homehacking.com). This book discusses coding .Net projects for home control. Links to sample chapters are available on the left margin of the page.

Wednesday, August 17, 2005

30 New SharePoint Applications

Microsoft has recently published 30 new SharePoint applications, available for download. This is a testament to how versatile SharePoint is and how well it applies to every business. All applications and templates are available for download at http://www.microsoft.com/technet/prodtechnol/sppt/wssapps/default.mspx.

This month's SIG meeting will be discussing SharePoint 2003 and it's many uses. The meeting is scheduled for Tuesday, August 23, 2005, 6:30 PM - 8:30 PM. It will be held at Cuyahoga Community College (Corporate College Campus - 25425 Center Ridge Road, Westlake, OH 44145) room 211.

Thursday, August 11, 2005

Make your web site talk !

I came across the SitePal web site and thought it was very cool. Once you subscribe to the service, you can choose an animated character that would read your web site or portions of it to your users. This helps to hold the attention of users so you eventually get more increased traffic to your site.

The speech is very fluid and character movement is very realistic. Absolutely no programming knowledge is required to use SitePal. However, SitePal does interface with various programming languages for those who are technically inclined.

For more information, check out http://www.sitepal.com