.NET General (RSS)

.NET General

DataBinding with Nullable types

One of the new thrilling features in .NET 2.0 is the introduction of generics, and as an consequence we also got the Nullable type.
Nullable makes it possible to set value types (Integer, DateTime) to null.

When using Windows Forms Data Binding in combination with Business Objects with members of type Nullable, you soon run into problems when you whant to set the DataMember to null. There is no buildt-in way to do this. At the P&P Summit in Oslo last week I discusses this problem with Rockford Lhotka, we came up with  a solution using the ProviderExtension modell in Windows Forms.

A colleague of mine Thomas Bruusgaard wrote this blogpost about how to implement the NullableExtension.  
You can aslo read what Rocky wrote about this.

 

SqlException: General network error. Check your network documentation.

There is a lot of people out there complaining about SQL Server returning a General network error while executing a command form ADO.NET version 1.1 or 1.0. Since it is a General network error, it seems to me that there are as many reasons for this error as there are people having it. I found several postings and articles about this strange error message, and finnaly I also found a workaround that fixed the problem for me...

What i did was to append: max pool size = 7500, to my connection string.
This fixed the problem, but didn't explain why the problem occured in the first place.. What I discovered later on was that Norton Internet Security was blocking requests to my SQL server, causing some strange errors while pooling connections. When disabling Norton Internet Security, SQL Server works perfect again.. Even without the max pool size setting in the connection string.

 

 

System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.

Problem
When usign System.Data.OracleClient with Oracle9i client, i got the following message while connecting to the Oracle database from and ASP.NET application.

System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.


Cause
Security permissions were not properly set when the Oracle 9i Release 2 client was installed on Windows with NTFS. The result of this is that content of the ORACLE_HOME directory is not visible to Authenticated Users on the machine; this again causes an error while the System.Data.OracleClient is communicating with the Oracle Connectivity software from an ASP.NET using Authenticated User privileges.

Solution
To fix the problem you have to give the Authenticated Users group privilege to the Oracle Home directory.

  • Log on to Windwos as a user with Administrator privileges.
  • Start Window Explorer and navigate to the ORACLE_HOME folder.
  • Choose properties on the ORACLE_HOME folder.
  • Click the “Security” tab of the “Properties” window.
  • Click on “Authenticated Users” item in the “Name” list.
  • Uncheck the “Read and Execute” box in the “Permissions” list under the “Allow” column.
  • Re-check the “Read and Execute” box under the “Allow” column
  • Click the “Advanced” button and in the “Permission Entries” verify that “Authenticated Users” are listed with permission = “Read & Execute”, and Apply To = “This folder, subfolders and files”. If not, edit that line and make sure that “Apply To” drop-down box is set to “This folder, subfolders and files”. This should already be set properly but it is important that you verify it.
  • Click the “Ok” button until you close out all of the security properties windows. The cursor may present the hour glass for a few seconds as it applies the permissions you just changed to all subfolders and files.
  • Reboot, to assure that the changes have taken effect.

Try your application again.

Team Development with Visual Studio .NET and Visual SourceSafe

I found this very usefull article on MSDN about Team Development with Visual Studio.

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

The article among other things explains how to use Visual Source Safe with ASP.NET project.

Validation of Entity objects.

When working with entity objects the need of validating object members occurs. Especially when sending entity object through layers or while saving data to databases, validation is important. I’m now working on an Entity Validation library.

The idea is to tag the entity members with Attributes and then run the entire entity class through a validation method. The validation method then throws exceptions if the validation fails.

 

Bindable entity objects.

I just posted an article about how to build entity objects with designer support in Visual Studio.NET. Hope this article is usefull.