Tag | Database Posts

EDIT: It turned out that the original example herein is not very clear about the point I want to make. Therefore I posted a follow-up with a better and more precise example (see here). Recently, I came about this blog post, which describes an interesting problem about NHibernate, lazy loading, and polymorphism. My initial thoughts were that this would be another one of these fancy technical details that a developer has to deal with all the time. But after a while it grew bigger and bigger in my mind ...

We already talked often about providing design time data to your designers in Windows Presentation Foundation and in Silverlight, thus enabling them to work visually in design editors such as Expression Blend or the Visual Studio designer (codenamed Cider).

Read the rest of this entry »

I posted last year regarding a dependency management tool I was contemplating. Well, I can happily announce that I did create and launch the tool as I had envisioned it. (I just actually completed a lunch and learn today where I unveiled it to a few more people within the company) In essence, it works by spidering the BUILD environment nightly and records all dependencies from code to code, from code to database and from database to database. We have over 100 .Net solutions with multiple projects ...
I’m participating in the Microsoft Gemini CTP (Gemini is the self-service BI component cooperatively provided by the forthcoming SQL Server 2008 R2, Excel 2010 and SharePoint 2010) and the SQL Azure CTP. I found intriguing the question of whether these two CTP technologies could be used together. Turns out they can! I successfully got Gemini to import data from a SQL Azure Database (after migrating the AdventureWorksDW2008 dimCurrency table into an Azure database called AWCloud)! I set up the connection ...
A little while back I posted a question on Channel 9 wanting to know more about SQL Server ‘Madison’ project. Well Charles Torre being the extremely nice bloke that he is (Thanks Charles I owe you another beer, perhaps not London Pride next time!) got on a plane from Redmond down to Orange County and went to pay the Madison development team and in particular Christian Kleinerman for is the Product Unit Manager for the Madison development, a visit The video is a good introduction into Madison, it ...
This example shows the basic way on how to populate a data from database to a ListBox/DropDownList control using LINQ to SQL. Note that I used Northwind database here just for the simplicity of this example. To get started then let’s go ahead and add a new item in your website application in Visual Studio 2008 or VWD Express 2008. To do this, just right click on the web site -> select Add New Item -> and on the Templates select LINQ to SQL Classes as shown below and click ok: Now open up Server ...
The Regina Technology Community welcomes Nick Nastic! Topic: SQL Server 2008 R2 and project codename "Madison" SQL Server 2008 R2 is the next generation of the Microsoft SQL Server database platform, planned for release in the first half of 2010. SQL Server 2008 R2 expands on the value delivered in SQL Server 2008 to help organizations improve IT and developer efficiency with: new and enhanced tools for the management of applications and multiple servers master data services complex event processing ...
Saas vs. S+S Saas is an architectural paradigm where a solution architecture can benefit from the economies of scale of the data and behavior of that architecture being built and hosted in the cloud by a third party in a multitenant fashion. Software + Services is an architectural paradigm where a solution architecture can achieve some of the same economies of scale as Saas while simultaneously benefiting from the synergies and efficiencies of the data and behavior of that architecture being partly ...
Steps to make a disaster back up: Record which Web applications are associated with the SSPs · Perform a full back up of the SSPs. · Completely stop the farm by stopping the services associated with Office SharePoint Server 2007 and by stopping Internet Information Services (IIS). · Back up the following databases by using SQL Server 2005 tools: o Content databases o Central Administration content database o Configuration database o Windows SharePoint Services Help Search database o Back Up the SQL ...
This past week I was reminded of the “fun” in which hosting an application within SharePoint can present. We are developing a custom application for our client in which some areas must reside within a SharePoint environment. We did quite a bit of our development in this first iteration within a web application in order to pull things together and present the client with a working end-to-end “prototype.” The architecture is composed of several layers all of which will be “in process” communications ...
A recent episode of .NET Rocks asked this very question, and listening to the episode made me consider my thoughts on the matter. [Disclaimer: Some of this post may be interpreted as “beating up on Microsoft”. This is not my intent. I use Microsoft in my examples because Microsoft development experiences have been the totality of my professional career. The issues I apply to Microsoft can assuredly be applied to any other company out there.] The short answer is “no”. I started writing software for ...
NHibernate's EnumStringType is a custom user type to realize an arbitrary mapping between an enum in your domain code and a related set of strings in your database. While playing around with it, I stumbled over some strange behaviour that turned out to be a bug in NH's codebase. It took me two days to finally nail down the problem. This post is mainly intended to be a short recap of my findings. Hopefully I can prevent some other poor developer souls to get stuck with the same problem, providing ...
I’m very pleased to announce the newest technical community to Manitoba: the Winnipeg SQL Server User Group, a PASS Associated Organization! Myself and Michael DeFehr are running this group and are excited to provide a forum for database professionals working in the Microsoft space. Here are the details for our first event: T-SQL Development: Bullet-Dodging and Spoon-Bending Michael DeFehr, Protegra Did you think you could dodge bullets with SQL server? Well if you learn some of these techniques, ...
Yes I know it's been a while since I blogged about my *favorite* development tool... but that's only because I haven't had to touch it! That smooth series of events was shattered yesterday with me experiencing the Thrill of Victory and Agony of Defeat in multiple cycles... and as you can guess it involved Crystal Reports. So here's the deal... I'm working inside what a fellow developer called a 'Draconian' environment. .NET 2.0 is the 'standard' although I installed 3.5 SP1 on this box (and either ...
Well, I crashed and burned tonight. I knew the information, but I had one small problem, that kept my demo from working. I added the SchemaNameConvention to the Data project for handling database schemas, and added it to the Fluent NHibernate conventions list. I SHOULD NOT, however, have changed the code for getting the Id of the domain objects. What this does, is it looks at the object and determines, by domain signature attributes, which property mappings need to be mapped as an Id not a property. ...
I feel a series coming on! I have been involved with a client to develop and customize their present SharePoint Environment. I have incorporated several solutions I would like to share. It was a learning experience and it was definitely Fringe SharePoint!!! The purpose of this post is to set up the scenario and to describe all the factors that were involved with the decision making of the overall solution. I hit several walls and blocking issues and feel it's important for anyone doing anything remotely ...
In some scenarios, you may have a database that contains text data in a column which is restricted to a certain set of discrete values. In such a case it is a good idea to use an enumeration for representing these data in your domain. - I occasionally came across this situation when I had to deal with legacy databases with large amounts of pre-existing data. - This post demonstrates an easy and effective way to put this "enum value vs. database string" mapping under test, using the xUnit.net unit ...
Create a rss or atom feed is very simple in asp.net mvc. In V1.0 there isn’t a build-in mechanism to work with feeds, however we can very quickly build our own. All we have to do is create a xml structure accordance with their specification and new ActionResult derived class to handle the result. But let’s start form beginning. The first of all, we need to create a new MVC project and call it e.g. RssFeed. The data for feeds will be taken from database, so we have to build model. Let’s create a new ...
Originally Posted Here: http://www.thegrubbsian.com... I’m almost positive someone has come up with this pattern before, but it was a big help on a recent project so I thought I’d share it. The basic goal of the pattern is to make the setup and teardown work of test classes reusable. We found this to cause particular pain for integration tests written against a database where multiple dependent records needed to be created before the actual test could be performed. ...
Before we had Azure and the various bits and pieces that became Azure at PDC 2008 Microsoft had a number of disparate groups working on various ‘cloudy’ projects. these included BizTalk Services, Red dog, Mesh and the Live framework to name a few. Then at PDC 2008 with the wave of a marketing teams wand they all be became Azure or Azure Services or Azure platform or …well anyway the over-arching message was that they were all part of Azure!! Furthermore we were presented with the vision below… Now ...
IDG News Service — Microsoft on Tuesday released technology previews of SQL Azure, the database for its Azure cloud infrastructure platform, and SQL Server StreamInsight, its entry in the CEP (complex event processing) arena. Microsoft issues SQL Azure, CEP platform previews | ITworld ...
During the last days and weeks, there's an increasingly heated debate about the performance of NHibernate vs. some other commercial and noncommercial ORMs. This debate was triggered by the launch of a new website called ORMBattle.NET, which is allegedly "devoted to direct ORM comparison" (and hosted by a commercial competitor of NH...). The comparisons are largely based on batch processing tests like this one: protected override void InsertTest(int count) { using (var transaction = session.BeginTransaction()) ...
In large projects you may have have a big number of enumerations in your domain code that have all to be kept in sync with some corresponding database stuff. Ensuring this correspondence is boring, repetitive and error-prone. Because it is such a tedious task, chances are that you don't check this at all, opening the door for serious runtime failures - especially when the project is nearing the deadline and things generally tend to become a bit more chaotic. I love enums. I use them wherever possible. ...
In most of the DBs in the server will have more space, when the backup is used to store it in the development environment or testing environment, it might not have much data, but it will occupy more space physically. To reduce the database size, then there is a way to reduce it. Shrink the Transactional Log. There are two ways of shrinking the Transaction Log. One is through Front-End and another is manual script. Front-End: Databases -> DbName. Right click on the DbName, then go to Tasks->Shrink->Files. ...
Basically, we need two files to restore the database. They are .mdf and .ldf files. There is another way to restore the database, if we have the database backup file(.bak). But we can restore using one file(.mdf file) as well. Here's how it will be restored using .mdf file. -- Restore Database using MDF File alone EXEC sp_attach_single_file_db @dbname = 'testerDB', @physname = 'c:\testDB.mdf' Hope this might help ...
In this Issue: Colin Eberhardt, Danijel Stulic, Jonathan van de Veen, Corey Schuman, Jesse Liberty, and David Anson. Shoutouts: Karen Corby announced: Updated FlickrViewr for Silverlight 3 I saw this first at Frank LaVigne's site, but others have it posted as well... the Seattle Silverlight 3 FireStarter will be streamed if you can't get to Seattle. Sounds like a vacation day for me! From SilverlightCream.com: Declarative Dependency Property Definition with T4 + DTE Colin Eberhardt revisits a previous ...
When I wrote the first post in this series, there was tremendous amount of interest generated and also a lot of feedback requesting to post some of the advanced features. Like I said earlier, ASP.NET 4.0 has lots of new features some of them as simple as Page.Title whereas so as big as caching improvements. This post covers one such feature which is Routing in Webforms. Although Routing was available even in .NET 3.5 SP1, (check this excellent post by Phil Haack on implementing Routing in ASP.NET ...
I decided to poke my head out of the bottomless cave that is Facebook/Silverlight development to post a nifty script we use at my current job to quickly back up all of our user databases after our production migrations, and copy these over to a handy network share: CREATE PROCEDURE sp_BackupAllData AS DECLARE @dbName VARCHAR(50) DECLARE @bakName VARCHAR(100) DECLARE db_cursor CURSOR FOR --Skip the System databases SELECT name FROM sysdatabases WHERE dbid > 4 OPEN db_cursor FETCH NEXT FROM db_cursor ...
Hello Folks, Today I'll will mention the Microsoft SQL Server 2008 Fileds data types, you need to choose the right data type for the database fileds for more speed efficency, and i think the most important thing the fundamental of the database itself. Let's begin: char: the char datatype is ifxed in length, if you enter fewer that than the number of character defined the remaining length will be space filled to the right; use this data type when the column dat is to be of fixed length, which tends ...
On a recent project I needed to test my application with lots of data so I remembered my good friend the Faker Gem from the Ruby world. I didn’t know how to connect ActiveRecord to SQL Server, so I searched the webs and found this article by Ray Houston at Los Techies. Unfortunately since the article was 13 months old, the Ruby libraries have evolved to not work that way anymore :) So after some head scratching I got it to work again. How to connect ActiveRecord to SQL Server If you don’t have Ruby ...
Here I am after a week of putting Windows 7 to the test while working frantically on a tight timeline project and am happy to say that all is well. It has crashed a time or two and I still cannot install Visio 2007 or SQL Server 2008 Developer Edition, but I am still pleased. It seems to be faster than XP and I quickly got the hang of using the UI and the search feature. There are quite a few handy conveniences that will make life easier such as the RDP client has a recently used list. I went ahead ...
This week I had a need for NUnit based unit testing against a class that depended on a provided SqlConnection. Up to this point I had been able to mock external objects and their behavior based on interfaces, but with a SqlConnection I could not mock. There are some options for mocking the SqlConnection such as TypeMock, but I needed a realistic connection to test against. This also proved as a good method for building the expected DB interface. The solution that worked best for my environment (only ...
Historically I have always viewed ASP.NET session state as “pure evil.” In-proc session state is about as unreliable as you can get given that you can have timeouts, ASP.NET might recycle itself, IIS might get bounced, no scalability, and cannot work in a web farm. SQL Session state is very resilient and works in web farm scenarios but the performance is not good and at that point you might as well be better off writing your own strongly-typed data access layer rather than blobbing everything in ...
We can use the rules engine to store parameters that can be accessed from orchestrations. To add parameters there are two basic steps: To create the parameters in a vocabulary in the rules engine and save them. a. Open the Microsoft Business Rule Composer. b. Add the new vocabulary. 2. To add .NET code to a BizTalk Helper class to access the vocabulary through the rules engine API. a. We can use the following code based and corrected of the code available at: http://www.apress.com/Apres... ...
In my new job, I'm one of the people responsible for implementing Application Lifecycle Management at a large (large) company. I and a bunch of others are gathering requirements, interviewing stakeholders, and so on. We're also running some cool pilots on the side. Anyway. We have narrowed the list of vendors who can help us down to 4. I won't tell you who they are because 1) I don't want to start a religious war, and 2) If there's a better one out there, we don't want to know this late in the process ...
(this is a repost since the initial post had a few issues that couldn’t be corrected) I am playing with the ASP.NET 4.0 QueryExtender released as a part of the Visual Studio 2010 Beta 1. It provides endless opportunities for working with data without writing much code and when you combine it with a few Ajax features, gives a truly great user experience with very less effort. To begin with you need the Visual Studio 2010 Beta 1 and .NET Framework 4.0 Beta 1. You can install both from http://msdn.microsoft.com/h... ...
The need As certain as the sun rising tomorrow, there will come the point where you will want to display a list or grid with paging. While many solutions exist, and many component developers are coming in with robust solutions, a simple and satisfactory solution can be created fairly easily. Implementation Why create a pager from scratch? Several reasons: 1) You want to control the pager completely – display, style and all. 2) You don't like the idea of JavaScript paging, which will load your hundreds ...
In my last blog I talked about the new site around SharePoint 2010 and the sneak peak videos. I got a chace to watch them and here are my notes: SharePoint 2010 Feature Highlights: New User Interface including new Ribbon Web Edit Silverlight Web Part Rich Theming Browser support for Safari, Firefox and IE Visio Services SharePoint Designer enhancements Business Connectivity Services (BDC evolution) SharePoint Workspaces (formerly Groove) or offline libraries Richer Media Support SharePoint 2010 Admin ...
For one of our new requirement , We have got into a situation in which we need to fire a SMS whenever an insert or update is happened in a database table. I gone through some articles and found out some methodologies to achieve this, 1. Query Notification (have more dependencies and complicated) 2. SQL CLR Triggers (Less dependencies , easy to understand and implement) I decided to implement SQL CLR triggers and got success also in that. Now let me share the things what I have done for implementing ...
Problem: I have a FormView inside an update panel inside a repeater. When i change the FormView to edit mode, and update text in my textbox (also with inserting text), the text that is inserted isn't adding in the linebreaks i input. If i set EnablePartialRendering="False" for the page it works correctly. This makes me think it's an error with AJAX and the update panel. I have checked the database to see what is being inputted and it seems the difference between using IE and Firefox/Safari is that ...
In my previous example, we have learned on how to save the actual image to a folder and image path to the database. In this example, I’m going to show on how to display those images in a GridView and Repeater control. To get started, let’s create a method for fetching the image information from the database. Here’s the code block below: private DataTable GetData() { DataTable dt = new DataTable(); SqlConnection connection = new SqlConnection(GetConnection... try { connection.Open(); string ...
I decided to write this example because this has been asked many times at the forums. In my previous article I have shown on how to Upload and Save the Images to Database, In this article I will show on how to upload and save the image to folder and path to database. To get started, let’s create a simple database table for storing the Image information and path to the database. I this example I named the table as “ImageInfo” with the following fields below: Note:I set the Id to auto increment so ...
Recently we have to create methods that will manually compare 2 objects and see if they are equal – essentially check if all their properties / fields are equal. Some of the fields are Nullable Types, which have been available since .NET 2.0 (VS2005). It is a nice construct to have, especially to represent database fields that can also be null – this makes coding simpler because a nullable type can also contain null as a valid value. Interestingly, talking some some people that have done .NET for ...
I’ve read a few tutorials online about paging with LINQ and an ObjectDataSource but there were always quirks that ended up slowing me down unnecessarily so I thought I’d put together my own easy to follow tutorial that should get someone up and running with paging in almost no time! Step 0: Things I will Assume about your Project I’ll assume that you have already created a DataContext and dropped in some tables from your database onto it. For my tutorial, I’ll again re-use the “Person” object that ...
I’ve just been porting a Windows Mobile (.Net CF) application over to the full Net Framework. I needed to provide a quick way of doing signature capture. I was pointed by a friend (thanks Ross), to look at hosting the WPF InkCanvas control on my Windows Forms, form. I just dropped a Panel (Panel1) on my form and used the following code - System.Windows.Controls.Ink... inkbox = null; public frmpleasesign() { InitializeComponent(); inkbox = new System.Windows.Controls.Ink... inkbox.Name = ...
Introduction Well it's now Saturday afternoon and the family have been out shopping all day, so I have taken the opportunity to conduct some tests that I had been meaning to do for a long time now (geek I hear you say). I wanted to find specifically what happens if you want to make changes to Content Types, Columns and Lists that have previously been deployed using Features and CAML. I am going to split my findings up into several posts. I will detail each set of tests then summarise at the end what ...
When it came time to start catching and handling exceptions in my program, I had never thought to use the events for ItemInserted, ItemDeleted and ItemUpdated for the ListView. They are incredibly useful. The events arguments passed as the second parameter expose some very useful properties that let you manage exceptions, access previously entered values and more. I’ve created a ListView and gone ahead and created the three events attached to it. Below you can see that the Intellisense has brought ...
So when I first started working with SQL Server 2008 and LINQ, I would pretty much just use the LinqDataSource because it was definitely the easiest to use. It’s pretty good for testing purposes, or really small projects, but if you’re doing anything that is going to grow / is large already, then you’ll probably not want all that logic embedded in your pages. As I became more comfortable with LINQ, I decided to take on the task of switching over to the ObjectDataSource to bind to my ListViews. Here’s ...
Introduction: In this post, I will explain you how can we get the countries name filled in any collection using .net without using any database. It is a regular task, which we all as developers did some past day but the difference is we used database table or xml file to hold the country names. But .net framework provide us with all the countries information in Globalization namespace. So, here is the code for that Dictionary<string,string... objDic = new Dictionary<string,string... foreach ...
Topeka DNUG is free for anyone to attend! Mark your calendars now! Speaker Dru Sellers is the Solution Architect for Federal Home Loan Bank in Topeka, KS. He has been programming professionally for over 8 years and spends most of his time in C# and VB.Net, Castle, and junk punches people who 'touch' his database. Topic Object Oriented Databases and other non-relational options Are you tired of writing SQL to maintain your databases? Are you using an object relational mapper and sick of the mapping? ...