What a long title :D. I use nUnit (funny how they use php for their website) for my testing together with Resharper they make a good team. So lets first look at one of my DomainObjects/Entities. Namespace AddressManagement ''' <summary> ''' ''' </summary> ''' <remarks></remarks> <CLSCompliant(True)> _ <NHibernate.Mapping.Attributes.JoinedSubclass(0, Table:="tbl_Country", extendstype:=GetType(Common.Translated), lazy:=False)> _ Public Class Country Inherits Common.Translated Implements Interfaces.ICountry #Region " Private members " ''' <summary> ''' A local variable called _name of type String ''' </summary> ''' <remarks>Has Property Name</remarks> Private _name As String #End Region #Region " Constructors " ''' <summary> ''' Default empty constructor ''' </summary> ''' <remarks></remarks> Public Sub New() Me.New("", New Common.Translation(), "") End Sub ''' <summary> ''' Constructor to fill the name. ''' </summary> ''' <param name="Name">Datatype = String</param> ''' <remarks></remarks> Public Sub New(ByVal Name As String) Me.New(Name, New Common.Translation(), "") End Sub ''' <summary> ''' Constructor with all the fields ''' </summary> ''' <param name="Name">DataType = String</param> ''' <param name="description"></param> ''' <param name="Remarks"></param> ''' <remarks></remarks> Public Sub New(ByVal Name As String, ByVal description As Common.Translation, ByVal Remarks As String) Me.Name = Name Me.Description = description Me.Remarks = Remarks ClearDirtyStatus() End Sub #End Region #Region " Public properties " ''' <summary> ''' This is the Name property. ''' </summary> ''' <value>String</value> ''' <returns>String</returns> ''' <remarks></remarks> <NHibernate.Mapping.Attributes.Key(1, column:="Id")> _ <NHibernate.Mapping.Attributes.Property(2, length:=50)> _ Public Overridable Property Name() As String Implements Interfaces.ICountry.Name, Common.Interfaces.ITranslatedSubClass.Key Get Return _name End Get Set(ByVal Value As String) _name = Value SetDirty() End Set End Property #End Region #Region " Overrides ToString " ''' <summary> ''' Overridden ToString method for this class ''' </summary> ''' <returns>String</returns> ''' <remarks>The String value of this class represented by the ToStrings of all it's private members</remarks> Public Overrides Function ToString() As String Dim ReturnString As New System.Text.StringBuilder() If _name IsNot Nothing Then ReturnString.Append("[Name: " & _name.ToString() & "]") End If Return ReturnString.ToString() End Function #End Region #Region " Overrides Equals " ''' <summary> ''' Overridden Equals method for this class ''' </summary> ''' <returns>Boolean</returns> ''' <remarks>The Boolean value indictaing if this is equal to the other class</remarks> Public Overrides Function Equals(ByVal obj As Object) As Boolean If obj IsNot Nothing Then If obj.GetType Is Me.GetType Then Return Me._name.Equals(CType(obj, Country)._name) Else Return False End If Else Return False End If End Function #End Region #Region " Overrides CompareTo " ''' <summary> ''' Overridden CompareTo method for this class ''' </summary> ''' <returns>Integer</returns> ''' <remarks></remarks> Public Overrides Function CompareTo(ByVal obj As Object) As Integer If obj IsNot Nothing Then If obj.GetType Is Me.GetType Then Return Me._name.CompareTo(CType(obj, Country)._name) Else Return -1 End If Else Return -1 End If End Function #End Region End Class End Namespace There is quit a lot of code in this simple Entity. First of all it inherits from Common.Translated (which I won’t show. But that in turn inherited from DomainEntity. Look at my post from a couple of days ago to see what that does.
This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.
Today I had a little problem with component mapping and the attributes. And It has something to do with the fact that all my objects use interfaces. I had this in my MspResult class. <NHibernate.Mapping.Attributes.ComponentProperty(componenttype:=GetType(Littlexyz))> _ Public Overridable Property Littlexyz() As Interfaces.ILittleXyz Implements IMspResult.Littlexyz Get _Log.LogDebug("Property Littlexyz - returning _Littlexyz") Return _littlexyz End Get Set(ByVal Value As Interfaces.ILittleXyz) _Log.LogDebug("Property Littlexyz - setting _Littlexyz") _littlexyz = Value End Set End Property``` And this in the Littlexyz class. <NHibernate.Mapping.Attributes.Component())> _ Public Class Littlexyz Implements ILittleXyz
SQL Server 2008 Release Candidate 0 has been made available for download to people who have a MSDN subscription The download is a little over 3GB, to be exact it is 3,118.13 MB SQL Server 2008 Release Candidate 0 (RC0) will automatically expire after 180 days. Each SQL Server 2008 RC0 download includes the following editions: SQL Server 2008 Developer Edition RC0 SQL Server 2008 Enterprise Edition RC0 SQL Server 2008 Standard Edition RC0
I never saw the need to add isdirty to a domainentity untill today. After showing the user a list of objects on the screen in a datagridview (which I don’t use very often) I then had to save that list. And there are two ways to go about it. Let nHibernate handle it or pick out the changed objects. Since the nhibernate route was a bit slow. I decided to do it myself and add an IsDirty to the Domain object.
Create an excel sheet In the first 2 rows put some data, save the excel sheet as testing.xls on the c drive Execute the command below SELECT * FROM OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:testing.xls','SELECT * FROM [Sheet1$]') You will see 1 row since the first row will be used for header names If you want 2 rows you need to add HDR=No like this SELECT * FROM OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:testing.xls;HDR=NO','SELECT * FROM [Sheet1$]') Run the following OPENROWSET command
Today I wanted to download Adobe Reader 8 so I could install it on our computers. Apparently Adobe doesn’t want you to do this. You have two options, Agree to their distrubition agreement (dutch version, sorry). or download it one by one on each computer which is a waste of bandwidth. Don’t they want firms to use it anymore? What is behind this decision? I don’t know. In the end I did the distribution agreement. So they first send you a mail to verify you are human or a smart bot. And then they try and send you another mail which happens to be encrypted. And guess what? Our Ironport virusscanner at the mailserver level doesn’t like that. So I ask you why are they sending the second mail encrypted? Why are they making life difficult for people?
TechNet Radio has 2 podcasts about SQL Server 2008 Part 1: industry experts Kimberly Tripp and Paul S. Randall about what is new in SQL 2008. Part One focuses on Security and Availability Part 2: experts Kimberly Tripp and Paul S. Randal talk about what is new in SQL 2008. Part two focuses on Management, Troubleshooting and Throttling Download part 1 here: http://download.microsoft.com/download/6/e/6/6e668f11-0e4b-40d1-9adb-084d5bb335a4/TechNetRadio03042008-web.wma Download part 2 here: http://download.microsoft.com/download/e/5/4/e5440aa4-8fa1-44ad-acaf-e513d3b89026/TechNetRadio03112008-web.wma Edit ——– Greg Low has also added another podcast on his site. In this podcast SQL Server CAT team leader Lubor Kollar discusses the role of the CAT team, SQL Server 2008 resource governor and compression.
Granted this one is due to the intellisense being a bit overactive, but can you spot the mistake? ''' <summary> ''' Select this record for printing ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> <NHibernate.Mapping.Attributes.Property()> _ Public Property Printed() As Boolean Implements Interfaces.ICDCover.Printed Get Return _printed End Get Set(ByVal value As Boolean) _printed = False End Set End Property``` I can :oops:.
Here is the new logo for SQL Server 2008. Looks pretty clean, what do you think? via Aaron Bertrand
In Visual studio 2008 you can use Solution folders to organize you projects. If you have an extra big solutions you don’t feel like splitting up then use the solution folders. The first image shows how to do it. And the second shows an image where you have multiple soulution folders.