How to reset Identity Increment value in MS SQL
Posted on March 22, 2008 | 8 Comments
An Identity column in SQL Server is used to auto number the rows. See this great post on Autonumbering & Identity Columns. When you delete rows from the table, the identity will not reset but you have few options of doing it yourself. The SQL Server Management Studio GUI doesn’t support this option…
1. DBCC CHECKIDENT
This is the most easy way, just set it yourself… Continue reading...
3 Ways to Run NUnit From Visual Studio
Posted on March 22, 2008 | 4 Comments
Like it or not, whoever wants to have a stable code, need to write unit tests. There are 2 main unit testing frameworks for .Net Environment: MBUnit and NUnit. During this post, I am going to focus on NUnit and its integration with Visual Studio in particular. ![]()
Once we wrote our unit tests and compiled them, an assembly file is Continue reading...
How to Use HttpWebRequest over SSL
Posted on March 19, 2008 | 2 Comments
If you try to use HttpWebRequest for calling secured sites, and you are getting the following exception: “The underlying connection was closed: Could not establish trust relationship with remote server” here is what’s happening and how you can (hopefully) solve it:
When browsing to a secured site with your web browser, you get a dialog asking if you trust the certificate provided by the server. If you invoke a web service or scrapping… Continue reading...
Why Convert.ToInt32 Might be Dangerous
Posted on March 19, 2008 | 6 Comments
Casting float to int is interesting. Not only it causes the value to get truncated, but it also changes binary representation. When you want to cast float to int you have two options:
1) If you came from c/c++, there are several ways to do cast operations but the natural thing would be to use (int).
2) You can also use the Convert class to do the job (C#).
Check this Continue reading...