This is unfortunately more of a hack than a solution, but I thought I would share it any way. I had the situation where I needed to validate the entered time into a masked textbox. The masked textbox is a Windows Form control, but I hosted it within a WPF window using the WIndowsFormsHost element. […]
Read More →Archive for September, 2012
Using LIKE with LINQ to NHibernate in C#
The equivalent to LIKE via the LINQ to NHibernate provider is Contains. An example of a LINQ to NHibernate that will return a result set matching a search like parameter is below. IQueryable<Classname> linqLIKE = (from m in session.Query<Classname>() where m.Code.Contains(“%dex%”) orderby m.CreateDate select m); IList<Classname> ListLIKE = linqLIKE.ToList(); The above […]
Read More →Upgrade from Oracle 10g to Oracle 11g with ODP.net and NHibernate ORA-12514
Firstly, let me say that there is nothing special about this upgrade. The instructions which I wrote here will still work with an 11g database. The issue I had was more with, what is the difference between a SID and a SERVICE_NAME which is used to identify the data instance to connection to. The SID […]
Read More →Attempted overcomplicated solution for a complicated system
I was working on a system which had implemented NHibernate, primarily for its ability to support multiple DBMS, such as Oracle and MS SQL Server. The problem came up when trying to insert, specifically in regards to the ID data type. On Oracle the ID data type was NHUMBER, while on MS SQL Server the […]
Read More →How to clear the data from a DataGrid using WPF in C#
I implemented some filtering into one of my DataGrids which required that a reset the initial result set. With a single line of code you can empty out the contents of the DataGrid. datagridResults.ItemsSource = null; Once I reset the contents to empty, I could then add the filtered content back into the DataGrid using […]
Read More →