Metro Style Window in WPF

A great article about  “Metro Style Window in WPF”

 

Metro Style Window in WPF.

 

 

Advertisements

Object writer utility

I generally try to make my application/code  to be run from Command line. There  its nice to print the object value also. (From test case you see pass or fail Sad smile  only )

 

So here is my utility here and you are free to enhance it. I have create a Object Writer util for print my object  .

image

 

 

Object Writer :

image

 

Output:

image

 

 

Hope this will help someone. You can also down load code files from here :

https://skydrive.live.com/embed?cid=1F188D9EA75A6E2B&resid=1F188D9EA75A6E2B%21416&authkey=ALKQRzGPEmFUYkc

Call Stored Procedure from Nhibernate

This may not the most efficient way to call stored procedure form Nhibernate using projects. But in my situation it first .In general when we uses  Nhibrnate there is almost no need to use. In my case I am mapping my application with Legacy Database so i need sometimes to call Stored Procedures from Nhibernate (though iI am trying my best to avoid this )..

So here is the simple way to use it pretty quickly :

1. Here is my Stored procedure

2. Here is the code snippet

SQL SERVER – Create Script to Copy Database Schema and All The Objects – Stored Procedure, Functions, Triggers, Tables, Views, Constraints and All Other Database Objects

After reading a post from Pinal I am proposing another solution here to automate SQL backup infrastructure. The dditional advantage here in this approach is , the SQL objects are always created in a seperate file so this can be really helpful to compare your chages in DB from your last version.

Steps :

1. Get file 0g_SqlExtract.vbs  or from attachement to this post.

2. Create a small batch file to call this script. Its handy to call it via batch file I guess. Ofcourseyou can use it   directly.

3. Pass the required parameter to the batch file

SET SERVER=%1
SET DB=%2
SET OUTPUT_FOLDER=%3
SET LOGIN=%4
SET PASSWORD=%5

cscript 0g_sqlextract.vbs %SERVER% %DB% %OUTPUT_FOLDER% %LOGIN% %PASSWORD%

4. Execute your batch file .

 

Download scripts from here

Thats it.

Have a great day

User Nhibernate with Legacy database

Topday we will talk little bit more about the Nhibernate topic. If you are new to this topic than

you can have look at  previous post

As its well accepted that Nhibernate is getting really (probably) first choice in applcation development
Its really easy to stary with Nhibernate for a new application development. You have more control
on your application  code and its db realtions .
Well  this doesnt go as smooth with Legacy DB as new application.

I have legacy database and it has many relations which could drive tyou crazy like anything .

Here in this post I will present a quick but very useful ways to map you WIERED realtions in Nhibernate using fluent Nhibernate.

Here is my small datamodel to explain this kinda of mapping

Data model

Mapping

 

Above mapping will create a mapping for the ToolLangTbl.

IF you notice int he mapping we have used CompositId to map such mappings.

Note :

In such cases always implement GetHashCode and Equal methods as below

 

 

If you still have some other wiered database relations and need help to map them ..I can try to help you in it.

Have a nice day ahead !!