Click here to Skip to main content
15,889,879 members

Abhishek Sur - Professional Profile



Summary

Follow on Twitter LinkedIn      Blog RSS
245,361
Author
29,042
Authority
4,069
Debator
960
Editor
32
Enquirer
1,073
Organiser
5,829
Participant
Did you like his post?

Oh, lets go a bit further to know him better.
Visit his Website : www.abhisheksur.com to know more about Abhishek.

Abhishek also authored a book on .NET 4.5 Features and recommends you to read it, you will learn a lot from it.
http://bit.ly/EXPERTCookBook

Basically he is from India, who loves to explore the .NET world. He loves to code and in his leisure you always find him talking about technical stuffs.

Working as a VP product of APPSeCONNECT, an integration platform of future, he does all sort of innovation around the product.

Have any problem? Write to him in his Forum.

You can also mail him directly to abhi2434@yahoo.com

Want a Coder like him for your project?
Drop him a mail to contact@abhisheksur.com

Visit His Blog

Dotnet Tricks and Tips



Dont forget to vote or share your comments about his Writing

 

Groups

Below is the list of groups in which the member is participating

United States United States
This _private_ forum is set up to be a place where political and social issues, including American politics and global warming, can be discussed in a reasonably civil manner. Anyone who has been an active member* of Code Project for six months is welcome to apply for membership but this forum does not tolerate trolling posts, or posters who wish to be disagreeable. Those who choose to become uncivil, insulting, or childish will be warned and, for repeated violations, removed from membership.

* That means that you have posted regularly or had at least one article published.

For member complaints and suggestions, contact the forum administrator at ...
cp[soapbox1[0 at gmail.com
Remove the [ characters and replace them by a period.
This is a Social Group
This member has Member status in this group

192 members
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
This is a Collaborative Group
This member has Member status in this group

136 members

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
GeneralRe: Congrats..! Pin
Abhishek Sur9-Jan-11 6:01
professionalAbhishek Sur9-Jan-11 6:01 
GeneralWindows 7 API Article Released Pin
Abhishek Sur28-Dec-09 6:30
professionalAbhishek Sur28-Dec-09 6:30 
GeneralGoogle Map Article Updated with StreetView Pin
Abhishek Sur1-Dec-09 21:45
professionalAbhishek Sur1-Dec-09 21:45 
GeneralGreat to see Bing Search API Pin
Abhishek Sur31-Oct-09 11:19
professionalAbhishek Sur31-Oct-09 11:19 
GeneralRe: Great to see Bing Search API Pin
Abhishek Sur4-Nov-09 8:47
professionalAbhishek Sur4-Nov-09 8:47 
GeneralRe: Great to see Bing Search API Pin
ranjan_namitaputra18-Nov-09 9:45
ranjan_namitaputra18-Nov-09 9:45 
GeneralNew Article Published Pin
Abhishek Sur1-Oct-09 10:39
professionalAbhishek Sur1-Oct-09 10:39 
GeneralDo you know about DirectCast and TryCast??? Pin
Abhishek Sur22-Sep-08 2:13
professionalAbhishek Sur22-Sep-08 2:13 
Generally while doing our program in VB.NET or any language whatsoever, we come across some situation where we are in Dilemma of having more than one solution of a single problem. We think thoroughly of our knowledge base, search the Internet to get which one will be the best logic discuss with seniors or otherwise do random choice or anything. As a programmer, I always do face the problem. Let us take the example of casting in .NET.

We know, VB.NET always include Microsoft VisualBasic Namespace for your application internally, and you cannot remove the reference to that or even you don't find the namespace in the References list. This is because while you do programming with Visual Basic, your application would be enriched with some of the functionalities that Microsoft VisualBasic namespace have within your program. Take for instance Val, CStr, CInt etc. All of them are written inside Microsoft VisualBasic namespace and is included automatically in our program. They are are acting as language helpers in your program.

DirectCast:

Let us try to write one of this language helpers ourself.

Public Function CustomCInt(ByVal value as Object) as Integer
if typeof Value is Integer then
Dim i as Integer = CustomCInt(Value)
Return i
End Function

After viewing the above code you must be laughing like hell on what I have done with this. Actually my motive is to show you how difficult is to write a helper yourself without using CLR supported casting feature. Here comes the case of DirectCast. While using CInt, CStr, or CType you are actually calling a function which does similar to what I have written. Means it first checks if the type is convertable or not through Typeof Operator and then casts to appropriate Type.
DirectCast is the Simple CLR typecasting feature which you can use when you are sure about the cast. It avoids the sequence of checking in the helper Functions. Now you can write your own Helper Function like this:

Public Function CustomCInt(ByVal value as Object) as Integer
If TypeOf value is Integer then
Dim i as Integer = DirectCast(value,Integer)
Return i
End if
End Function

Now it looks great, Isnt it. Actually this is how .NET helpers are made, CType checks if the object corresponds to the Type specified and then DirectCast it to return the Converted Type Data. DirectCast is the most simple and CLR supported TypeCast feature that will cast properly if it is with appropriate type or otherwise throws an error.

TryCast:

Now going further, Lets start with TryCast. After knowing DirectCast you may wonder what exactly the TryCast is. Actually TryCast operator of VisualBasic is equivalent to 'is' operator of C#. TryCast is useful in some situations too.
Let us take the following example

Public Function CustomCheck(ByVal value as Object) as IDBConnection
If TypeOf value is IDBConnection then
Dim i as IDBConnection = DirectCast(value,IDBConnection)
Return i
End if
End Function

In this example, we are telling the CLR to check the type of Value that we passed to the Function using TypeOf function in the If statement. If it enters into the IF we can confirm that the value implements IDBConnection. But CLR doesn't knows it. Thus on the very next step, it will check if the value actually an implementation of IDBConnection again. Thus we are running redundant code. Using TryCast we can avoid that.
We may write

Dim i as IDBConnection = TryCast(value,IDBConnection)

This will direct the CLR to check if value implements IDBConnection and if so, it will convert it directly. Thus we removed Redundant code.
TryCast will store nothing if it cannot cast the value. In case of using TryCast for primitive types, it will store the value of initialization as output if it cannot convert. For Instance, conversion to integer will give you Zero(0) etc.

Hope you understand the two simple operators of Visual Basic. Don't forget to Comment on the topic. Thanks.

Abhishek Sur

GeneralRe: Do you know about DirectCast and TryCast??? Pin
Jony Shah3-Aug-09 8:02
Jony Shah3-Aug-09 8:02 
GeneralRe: Do you know about DirectCast and TryCast??? Pin
Abhishek Sur3-Aug-09 23:37
professionalAbhishek Sur3-Aug-09 23:37 
GeneralCongrats Pin
Abhijit Jana13-Aug-09 8:54
professionalAbhijit Jana13-Aug-09 8:54 
GeneralRe: Congrats Pin
Abhishek Sur13-Aug-09 8:57
professionalAbhishek Sur13-Aug-09 8:57 
GeneralRe: Do you know about DirectCast and TryCast??? Pin
ranjan_namitaputra19-Sep-09 9:43
ranjan_namitaputra19-Sep-09 9:43 
GeneralRe: Do you know about DirectCast and TryCast??? Pin
Abhishek Sur19-Sep-09 13:28
professionalAbhishek Sur19-Sep-09 13:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.