30 05 2017
One of my applications displays tables with some calculations about users working time. This is for corporate reporting. For this table I needed a way to find how many weekends days are in given month. As most of calculation work is done in SQL Server stored procedure I decided to keep stuff there and found a way how to get weekend days with common table expression.
24 05 2017
ASP.NET Core 2 comes with Razor Pages that allow developers to build simple web applications with less overhead compared to MVC. The emphazise is on the word “simple” as Razor Pages doesn’t come with patterns suitable for bigger and more complex applications. For this we have MVC that is flexible enough to build applications that will grow over years. This blog post uses simple shoutbox application to illustrate how to build applications using Razor Pages.
2 05 2017
Micro ORM-s are useful small ORM-s that are lightweight and map between objects and database queries. This blog post discusses when to use Micro ORM-s and provides example code where Micro ORM called Dapper is used.
7 04 2017
ASP.NET Core supports also distributed cache solutions. Out-of-box there is support for SQL Server and Redis based distributed caches. This blog post focuses to SQL Server based cache we can use when there are really no better options.
9 01 2017
Paging query results is timeless topic and some days ago I got question about how to do it with Entity Framework Core. Using my previous work on paging I wrote some simple extension methods that work with IEnumerable and IQueryable interfaces. There’s also method that maps entities to models.
16 11 2016
I published to Github sample temperature measuring solution that runs on Windows 10 IoT Core and that is built on Visual Studio. Source code with basic documentation is available too. This demo project is there to give some starting point to those who are visiting my Brewing Eisbock with Raspberry PI and Windows 10 IoT sessions in different conferences.
27 02 2016
I have local database where I insert some data and I want this data to be available also in cloud. As a lazy guy I don’t want to synchronize data manually. After setting up local and cloud databases I activated Azure Data Sync to just find out that it conflicts with EF7 insert and update queries. As I don’t have many tables and my database is pretty small I invented simple workaround.
4 02 2016
We are eager to try out our beer cooling solution and we want to see it in action. We want to visualize our data and keep eye on temperature of cooling beer. Before doing anything more complex like building web or mobile app we make a quick shortcut and bring our data to web, desktop and mobile. This post is about Power BI in action.
3 02 2016
When cooling beer we want to store history of temperatures for two reasons. First, it gives us valuable history data for next cooling sessions. As a second thing we can ask measurements when we temporarily lost connection with IoT Hub. In this posting we make some analyzis and then build up database for our beer cooling solution.
10 10 2013
Lately I had one weird experience on with running NHibernate on Windows Azure and I think it’s worth to share with you. NHibernate is matured industry-level ORM that is proven itself over years. Although it is not so easy to use as Entity Framework it is still my favorite due to flexibility and wide databases […]
17 07 2013
Some business systems use simple change tracking. User name and timestamp are saved when object is created and modified. In this posting I will show how to do it easily with NHibernate.
3 06 2013
Visual Studio database projects support database post-deployment scripts you can use to make additional modifications to database or to insert some test data. In my work I use database projects and post-deployment scripts very often. In this posting I will introduce you how to use post-deployment scripts to make dealing with database and data easier for developers.
7 02 2013
Stored procedures in SQL Server database can be unit tested using Visual Studio database unit tests. It may seem as simple thing to do at first but when you start writing tests then you will find out it’s more complex task to do then expected. In this posting I will introduce database testing with Visual Studio tools.
28 01 2013
Visual Studio database projects are good to support software development. I have successfully used database projects for years and I think it’s time to share my experiences also to global developers audience. In this posting I will introduce you how to effectively use database projects so developers are working with up-to-date schema and test data all the time.
20 10 2012
When preparing my Sinergija12 code examples I ran into interesting problem. Windows Azure local development storage hangs for about minute and gives StorageServerException stating that there was problem in web server. A little surf in search engines gave me solution.
2 01 2012
In one of my current projects I have some pivot reports that show count of issues in different states. Grouping depends on report. States are dynamic – admins can define new states and save them to states table. This means that I cannot hardcode names of states to queries. Instead I need dynamic pivots. In this posting I will show you how to write reporting procedures that offer dynamic pivoting capabilities.
30 12 2011
You may get the following error when creating data scripts with MSSQL 2008: The selected database contains foreign keys that create a cycle. Publishing data only is not supported for databases with cyclical foreign key relationships. This problem is caused by self-referencing tables and it is given even if you don’t export data from one of such tables. Here is simple and very dirty solution.
8 12 2011
In one of my applications I have to use week numbers as properties of business classes that are persisted to database using NHibernate. Week numbers are used in UI and users can filter and sort data by week numbers. In this posting I will show you how to make SQL Server deal with week numbers and how to use them in your domain model.
16 05 2011
In one of my projects I have to read FoxPro DBF-files and import data from them. As this code must run in server and customer doesn’t want to install FoxPro there we found another solution that seems at least to me way better. In this posting I will show you how to read DBF-files using Sybase Advantage data providers.
1 05 2011
Last Christmas I blogged about how to make ASP.NET MVC users authorized only if they have profiles created. This works well on public sites where everybody can be user. Sometimes we don’t want to let all users to our system even when they were correctly authenticated by some authentication service. In this blog post I will show you how to create authorization attribute that you can use to make authenticated users insert their access code if it is their first visit to site.