How to create MS SQL Server 2005 unique key step by step example
Posted on | April 18, 2008 | 5 Comments
Looking at the title many of you may think what is the justification to write so basic stuff!
I admit. Honestly I also admit that I was searching for this over Google ! I am totally new to SQL server environment and also have no idea about its IDE. MySQL and PostgreSQL are the two DBMS which I have been using for long issuing the commands writing on the Linux console.
Anyway, here is how:
1. Connect to to the server and right click on the table you want add a unique key.
2. Click modify
3. Right click on the design panel and select Indexes/Keys.
4. A dialog will open and click the Add button on the lower left.
5. It will create a new entry on the list on the left panel of this dialog.
6. Click the browse button (button with three dots ‘…’) on the right of the first item(Columns) in the list on the right panel.
7. On clicking button a new dialog will appear with a list. This list items contains all the column names in a drop down combo box. Select the column you want to set unique from the drop down.
If you want have multiple columns together is unique, select the columns on the second row.
Say, besides the ID column, you also want to have names to be unique for each role type. So you have to select both the name and role columns.
It will automatically add a new row to give option for the third column which can left empty.
Click ok when done. It will close the dialog.
8. Now, click on the combo right the the field named “Type“. Select Unique Key. And click Close not Add.
That’s All ! You have successfully set up a unique in MS SQL Server 2005
Sorry.. my previous hosting service crashed and all images are gone
![]()
JQuery custom attribute selector, extending JQuery
Posted on | April 15, 2008 | 5 Comments
Problem: In my current project, i had many links and divs which
performs some tasks as they are clicked. say, some are links in
the list which shows categories, clicking this links, i need to show
the items. Again, clicking each item, i need do some other tasks. In
this way, all the action links/divs can be categorized.
I need to tell jquery to perform something on click event of those.
Current Solution:
Use different class or id and get it like $(”#id”) etc.
Problem of this:
It will limit you to use id’s which can be conflicting with other settings.
What I am doing:
Extended JQuery
say I have the following links(there are many other comtypes):
<a comtype=’category’ comid=” ….
<a comtype=’category’ comid=” ….
<a comtype=’category’ comid=” ….
Now, Need to bind click event to all comtype=’category’
jQuery.extend(
jQuery.expr[ ":" ],
{
catitem : (
“jQuery( a ).attr( comtype) == ‘category’ “
)}
);
The code above will let me do the below:
$(‘a:catitem’).bind(’click’,function(){
// do stuff});
Hope it may help you in such situations.
ScribeFire improvements 2008-04-13
Posted on | April 14, 2008 | No Comments
Wow!! just finished writing the earlier post on scribfire and need
to write another about its improvements.
1. Tabbed edit:
Now, you can create and edit multiple post at a time !
2. New control panel:
The left control panel is now with new look and features!!
3. Youtube and flickr addon!!!
Now, you can share your Youtube and flickr content !!!
Great work Chris!!!.
ScribeFire — Fireup your blogging
Posted on | April 14, 2008 | No Comments
Recently I made post on windows live writer. Since then I felt
little uneasy as I have not wrote any post on ScribeFire.. a simple,
efficient and feature rich blogging tool that was helping me for long.
ScribeFire is a Firefox extension. Unlike the blogging tool in Flock,
its much simpler and lightweight though heavy in options. You can
have the installer from here.
Having installed it you will find a little icon on the right of the status bar
of your FF browser:
![]()
Usually people feels to start writing a blog post when
they come across something interesting on the web, or a solution or
when they created something to share. In most cases it is initiated
by web. If see something on the web and like to share with all,
just press f8 and scribefire will slide to blog the page !
It really comes with some handy shortcuts which can be found here.
Take a look at the nice scribefire panel:
Middle panel is the editor, nothing more to say about it. But I like the
image addition features most. Unlike most of other blog tool scribefire
does not only provide image inserting by url but also from your
computer !!
The left panel contains the overall settings for scribefire. See the
options:
The right panel offers blog related settings like adding a blog,enter
trackback URL, manage entries,categories etc. Interesting is that, I can
also edit my WordPress static pages from here !!
Finally just to say, if you are not windows fan or tired of trying various
blog tools orrr have not yet tried any…. I would suggest just try scribefire!
Blogging will be more fun and easy !!
cheers.
Update is available here.
SQL Server permission problem in vista solved
Posted on | April 14, 2008 | No Comments
Recently I migrated to Window Vista and enjoying its cool looks
and features.
I was facing a weird problem with SQL Server. I am using SQL Server
2005 express edition that was available with VS 2005.
When I was trying to create a database the following problem raised:
As a result, I could not create any Database !! I failed to get
any answer from google.
Suddenly, one simple solution came in mind… right clicked on the
icon and run as administrator.
And it did the trick !!
cheers !
Assembla: Online project, with free svn,file upload,tickets and everything !!
Posted on | April 14, 2008 | No Comments
I was looking for an online space where I can securely host my project.
Google took me to Assembla after knocking a number of doors. Its an one stop solution for project
hosting.
You can create teams, have scrum meeting,chat, manage your
money(!),have wikis, different pages for a project…. etc etc.
Above all, it will allow you to have different project pages for everya
project you start !
Try it out !
How to unit testing with Visual Studio Team System 2008
Posted on | April 13, 2008 | No Comments
Testing is a vital part of any software project. In modern development
processes it is an umbrella task.
Visual Studio Team System 2008 offers an excellent way to perform
various types of test. It made testing as easy as it gets.
Lets see how to perform unit testing over a class.
Steps:
- Create a web project.
- Add a new class
- write a method, say
public String hello() { return “world”; } - Go to Test menu,
- Click New test.
- It will ask to create a test project first, give
- Then select add new test
- select unit test wizard
- select the files you want to test.
- Click Ok.
You will find XXXTest.vb file is created for every class.
XXX is the class name.
There a test class is created which has public routines like
YYYTest() for all the methods in XXX class. Here is a sample
descripion of such a basic function:
Public Sub helloTest()
Dim target As Class1_Accessor = New Class1_Accessor ‘ TODO: Initialize to an appropriate valueDim expected As String = “Worldss” ‘ TODO: Initialize to an appropriate value
Dim actual As String
actual = target.hello
Assert.AreEqual(expected, actual)
Assert.Inconclusive(”Verify the correctness of this test method.”)
End Sub
Look at the bolded word “Worldss” which I entered as the expected
result, certainly it is not expected, but is given to get a test failed
Now, run Test->Run->All tests in solution Ctr+R,A to run the test.
You can also run the test related to only the current context.
Enjoy programming… enjoy real programing..
Windows live Writer
Posted on | April 13, 2008 | 4 Comments
Have you ever tried windows live writer ? Try it once. I bet, you
wont be able to stop blogging !!
Its a great blogging tool with every feature you will ever need.
Have a look at the screen shot:
Sorry for the background, I forgot to close the VS 2008. )
The first tool that could recognize my blog settings just from the URL.
I have hosted wordpress on the root directory of my server. Just
before I tried scribfire and it failed to get the xmlrpc file.
Being a linux lover(also Vista lover :P, a bi-os-ual) I tried almost all
the blogging client available under linux( lately I was using Ubuntu).
None of them are as good as Windows live writer. Honestly speaking
keeping the emotion aside, none are even closer to windows live
writer.
Try and check my word.
Subversion with Visual studio 2008: free open source svn client AnkhSVN
Posted on | April 13, 2008 | No Comments
Recently I have installed Microsoft Visual Studio team system, 2008. This studio simply rocks. Enhanced speed is giving me a joyful experience!
Anyway, version controlling is a major issue for any development and I never liked VSS nor used it, rather I am used to with using subversion. For windows, I like TortoiseSVN. Its simply superb and simple.
But, human mind wants more
I needed a subversion client for my visual studio ! Google gave a suggestion : AnkhSVN!!! An excellent opensource( cheers ), free and quality tool for visual studio. Just look at some screen shots :
Enjoy !
Firefox round corner css only, no gif
Posted on | March 27, 2008 | 5 Comments
Every border has its own set of native functions support some cool features to the developers. Like IE has gradient feature built in!
One nice feature of Firefox is to support rounded corner without any extra hassle. With no gif at all!
here is how:
-moz-border-radius:20px
Lazy enough? Just copy the code and see yourself!
<div style=’-moz-border-radius:20px;background-color:#ff0000′>
Hello rounded Firefox world !
</div>
See the effect here:
Hello rounded Firefox world !

