tag:blogger.com,1999:blog-78084725430565608462024-03-13T08:13:11.268+05:30Gaurav Sharma a.k.a ~bLaCkHaWk~"Be peaceful, be courteous, obey the law, respect everyone; but if someone puts his hand on you, send him to the cemetery" - Malcolm X~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.comBlogger50125tag:blogger.com,1999:blog-7808472543056560846.post-56387406200789709022010-08-17T23:21:00.002+05:302010-08-17T23:24:23.223+05:30LINQ to SQL – Generic InsertCurrently I’m working on a project’s data layer code. I’ve chosen LINQ to SQL for this purpose and created a helper library to perform CRUD operations in an easy and generic way. Following is the code which insert any database object using LINQ: 1: public static void Insert<T>(T entityData) where T : class<!--CRLF--> 2: {<!--CRLF--> 3: using (TransactionScope trans = new ~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com20tag:blogger.com,1999:blog-7808472543056560846.post-16740825158224864772010-08-11T08:34:00.001+05:302010-08-11T08:34:16.722+05:30SQL Server - NULLThere is a bit of inconsistency in the way SQL Server treats (read it as implements) NULLs. Following are some noteworthy points related to implementation and usage of NULL values in SQL Server: 3 possible values of logical expression TRUE FALSE UNKNOWN UNKNOWN occurs when a logical expression involves NULL NULL > 2 is UNKNOWN NULL = NULL is UNKNOWN X + NULL is UNKNOWN (NOT (UNKNOWN~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com0tag:blogger.com,1999:blog-7808472543056560846.post-90299175702822025012010-06-24T17:10:00.001+05:302010-06-24T17:16:22.928+05:30Windows Azure – Custom configuration settingsFew days back, I received a question on our internal Azure discussion DL regarding, how we can have settings defined in a web configuration file implemented in a web role. In simple terms, how we can have configuration file in a Windows Azure application. This is how we can do this; During development ServiceDefinition.csdef – Add name of your custom configuration ~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com3tag:blogger.com,1999:blog-7808472543056560846.post-45575618288001926242010-05-01T11:47:00.001+05:302010-05-01T11:52:41.639+05:30Post Back from AJAX Update PanelRecently, while working on a dev assignment I needed to make a complete post back (with page refresh) from a button control placed inside AJAX Update Panel. Exact problem was like this. There is a webpage on which I require AJAX functionality. Also, there is one button on whose click I want to make a post back. That button is also placed inside AJAX update panel and anything placed inside update ~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com0tag:blogger.com,1999:blog-7808472543056560846.post-2270177667342212622010-03-12T02:37:00.001+05:302010-03-12T02:40:57.537+05:30WCF – Exception Handling in Asynchronous OperationsYesterday, I got a query regarding how to handle exceptions in case of asynchronous web service operations. Precise question was, I am calling a WCF service using Asynchronous way,  the service may execute for some time, meanwhile if any exception occurred in the service side how can I come to know what happened in the service side? I am not able to get the status in the Async Method.~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com6tag:blogger.com,1999:blog-7808472543056560846.post-26184863244002730572010-03-03T20:51:00.001+05:302010-03-03T20:53:42.089+05:30GO – SQL ServerWhile working on SQL Server we all encounter GO statement quite often. Till today GO statement for me was just an indication sent out to SQL Server utilities about end of a batch of Transact - SQL. Today while going through MSDN I found a new (surprising) thing about GO. Go can actually take an integer argument. Yes! it is true. Go takes an optional integer argument. Something like this, GO [~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com1tag:blogger.com,1999:blog-7808472543056560846.post-50549076307603225422010-02-19T08:28:00.001+05:302010-02-19T08:28:38.215+05:30Back from RedmondFew weeks back I visited Microsoft office in Redmond, WA. That trip turned out to be a super roller coaster ride. Day I landed in our office some unexpected very high priority work came up and we started work on it without wasting any time. I got to work with some top technical and management guys. During my work I interacted with various Microsoft GM’s and members of top leadership team. I ~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com2tag:blogger.com,1999:blog-7808472543056560846.post-45225139445714341872010-01-08T08:51:00.001+05:302010-01-08T08:51:23.669+05:30IIS 7.0 – Site Vs. Application Vs. Virtual Directory Another thing with IIS 7.0 which always bothers me is exact difference between web site , application and virtual directory. There is lot of verbose information present online related to this topic. After going through few good web links I managed to prepare a summary of the differences, that is easy to understand and remember. [ Note: It is highly possible that you might get this information~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com1tag:blogger.com,1999:blog-7808472543056560846.post-52967523019632535112010-01-07T07:59:00.001+05:302010-01-07T07:59:17.512+05:30IIS 7.0 – Classic and Integrated pipelineWhile creating a new app pool, users are required to choose framework version and pipeline type. I was not sure about the difference between available pipeline types. I spent some time on this topic and reading MSDN articles. this is what I understood: Classic Pipe Line in IIS 7.0 Works just like IIS 6.0 All requests pass through the IIS pipeline first, and then if the file extension is ~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com1tag:blogger.com,1999:blog-7808472543056560846.post-34127919557845348222009-12-19T20:20:00.001+05:302009-12-19T20:28:58.490+05:30Windows Live WriterThis is my first post on blog spot using windows live write. There is no special content in this post. I wanted to check if all plug-ins will work as they are supposed to work. Image One Two Three Four Map Code using System;internal class MySampleClass{ void MySampleClass() { //~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com1tag:blogger.com,1999:blog-7808472543056560846.post-59726195324115588122009-12-18T20:42:00.001+05:302009-12-18T20:49:47.188+05:30Linked In - Sophisticated version of Monster jobI’m using linked-in from past one year now and initially I felt it is a nice networking tool for people looking to connect with people with similar appetite towards technology. Suppose, if I’m looking out for a mentor, it is actually tough to achieve this using linked in. What best you can do is this, message your friends and ask them if they know anybody who can mentor you and keep doing this ~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com1tag:blogger.com,1999:blog-7808472543056560846.post-60994701164889147472009-12-06T20:43:00.003+05:302009-12-08T18:46:49.760+05:30SQL Server - Size of Index Table for Each IndexI'm a regular reader of Pinal's SQL Authority blog. Few days back, he posted a puzzle to find index size of each index on table. I was able to solve the puzzle and my solution was one of the two solutions selected by Pinal. Check it out from here//Cheers!//Currently listening to - Thirteen by Danzing~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com0tag:blogger.com,1999:blog-7808472543056560846.post-47895653355171118722009-12-06T20:25:00.004+05:302009-12-06T20:43:04.821+05:30System.Transaction.IsolationLevelA little amusing observation,IsolationLevel enumeration defined in the System.Transactions namespace looks something like this:public enum IsolationLevel{ Unspecified, ReadUncommitted, RepeatableRead, ReadCommitted, Serializable, Chaos, Snapshot} By definition, chaos means -"a state of extreme confusion and disporder. " Initially I was not able to understand what is the whole ~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com3tag:blogger.com,1999:blog-7808472543056560846.post-64595352192784059732009-11-01T23:08:00.006+05:302009-11-01T23:17:42.673+05:30Visual Studio 2010 Beta 2From last few weeks I'm using VS 2010 for my daily coding work. Apart from lot of feature add-ons, this time VS got a new look. Check out these captures;Visual Studio 2010 Beta 2 - Splash ScreenNew Startup ScreenVS 2010 Rocks!!!Scott Gu is running a series on VS 2010 and .Net 4.0 new features. Do check them out at his blogCheers!~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com1tag:blogger.com,1999:blog-7808472543056560846.post-57916361368032239392009-10-07T19:46:00.006+05:302009-10-07T20:03:14.604+05:30Simplest way to prevent Phishing Attack on IE 8Phishing attacks are becoming common these days. Recently there was a massive phishing attack reported on Hotmail. There are few easy ways by which we can prevent phishing attacks.I use IE 8 as my default browser and it provides a nice feature known as Smart Screen Filter which helps us in identifying phishing attacks. There is also a online publication provided by Microsoft that helps in ~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com0tag:blogger.com,1999:blog-7808472543056560846.post-74193121843452729782009-09-26T19:58:00.007+05:302009-09-26T21:16:17.610+05:30Library Design - Documenting ExceptionsI’m sure most of you might already know but I thought of sharing this. If we are coding for a class library then we should always try to explicitly provide exception type that our code (method) will throw. If we provide exception values in XML Comments then those exceptions will appear in intellisense while we are using that library method. This will be handy for developers using our library. I ~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com0tag:blogger.com,1999:blog-7808472543056560846.post-40596602650857478482009-06-08T23:04:00.002+05:302009-06-08T23:07:47.999+05:30Functional ProgrammingFew days back while reading about F# I got hold of a nice old article on Functional Programming. Check it out hereI'm on my F# journey from past few weeks. Let us see how far this goes.~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com0tag:blogger.com,1999:blog-7808472543056560846.post-51360033691406033702009-05-20T20:43:00.003+05:302009-05-24T22:16:53.195+05:30SQL Server 2008 - Policy Based ManagementFew days back I posted an article on MSDN related to SQL Server 2008 Policy Based Management. Check it our if you are interested in Server 2008 new features.~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com0tag:blogger.com,1999:blog-7808472543056560846.post-40537314064548603002009-04-26T10:59:00.005+05:302009-04-26T11:37:05.507+05:30New definition to C#If anyone asksus , what is C#, what will be our answer? All of us will say, C# is an Object Oriented Language targeting .NET run time. Today this definition of C# is only 10% correct or you can say 10% complete. Surprised! read ahead.Few days back, I was listening to Anders Hejlsberg's PDC 2008 presentation on C# 4.0. There he formulated a new definition for C#.C# is a multi-paradigm language ~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com2tag:blogger.com,1999:blog-7808472543056560846.post-20364516239736994962009-04-18T23:38:00.004+05:302009-04-18T23:56:18.966+05:30Places where I'm bloggingConnected Information Security Group blog. This is now closed as our team name is changed.http//blogs.msdn.com/cisg/Our team got a new name, Information Security Tools, hence a new blog site,http://blogs.msdn.com/securitytools/My good old blogspot account where I started blogging few years back.http://fun-with-blackhawk.blogspot.com/ I'll use security tools blog for topics related to my work and ~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com0tag:blogger.com,1999:blog-7808472543056560846.post-80773122143309512992009-04-18T22:51:00.007+05:302009-04-18T23:55:37.154+05:30Safer Source Control Settings in Visual Studio 2008There is a section for Source Control settings under Visual Studio IDE options where we can set check in and checkout behavior. Two important settings are:* Save: Check out automatically (default)* Editing: Check out automatically (default)As per my experience these defaults are not good/ safe. These settings could result in: * Checking out files without knowledge, as even a single click or key~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com0tag:blogger.com,1999:blog-7808472543056560846.post-19383685156813920392009-04-06T20:19:00.003+05:302009-04-06T20:37:27.177+05:30Where is Gaurav?<!--[if gte mso 9]> Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4 <![endif]--><!--[if gte mso 9]>~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com0tag:blogger.com,1999:blog-7808472543056560846.post-13933286707688584552008-02-24T02:27:00.005+05:302008-02-24T02:40:21.238+05:30STRUTS Vs ASP.NETI found a good white paper on MSDN related to Struts and ASP.Net architecture comparison.http://msdn2.microsoft.com/en-us/library/aa478961.aspxAfter reading, it looks like ASP.NET is better than STRUTS. But as white paper is published on MSDN, I am not sure every feature of STRUTS is covered.Now check this out., how Java guys are fuming over this...nice funCurrently Listening - Pyaar Ka ~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com0tag:blogger.com,1999:blog-7808472543056560846.post-67362052067501167632008-02-23T12:12:00.003+05:302008-02-23T12:18:57.633+05:30Google search - Rank 1Go to Google.com and search for,GAURAV SHARMA C#My blog ranks first in Google result. Amazing (at least for me) !!!If currently its not ranked no. 1 check this out as proof :)~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com0tag:blogger.com,1999:blog-7808472543056560846.post-66977098268245927442008-02-07T09:47:00.000+05:302008-02-07T12:37:36.453+05:30C# 3.5 - Properties ShorthandI must tell you if today your C# knowledge is not up to date then you might face tough time with future versions of the language. Microsoft developers will keep on adding new things ranging from entirely new features like LINQ to something like Implicit types or Object initializations. Last two features that I've mentioned are due to LINQ and secondly they provide some kind of syntactical sugar ~bLaCkHaWk~http://www.blogger.com/profile/05789924050831092085noreply@blogger.com22