|
| |
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
Matching Braces
If you program in c# where you find yourself lost in brace wonderland. All you need to do is to press CTRL + } to match the brace that your cursor is next to. This obviously makes life easier with nested
ifs/fors/whiles/etc
Wrap/Unwrap
If you are in the habit of writing long lines to preserve your code readability, you can toggle word wrap using CTRL + R twice. That way your code is neat and tidy, but can be viewed without moving way out to the end of the line and back (which is a horrible pain) when you need to see what's going on.
Full Screen
press ALT + SHIFT + ENTER That will toggle your view to full screen. Pretty nice.
Pane toggling
It's always good to be able to ALT + TAB between different applications on your box. If you use CTRL + F6 you can do the same thing with panes in
VS.NET. |
|
Some days back during my last day of asp.net training
session, I was told to give some Gyan on following some best practices
while writing programs, so one of my clue was that you should enclose your
statements with try catch block
Highly inspired by my Gyan a programmer wrote this.. "CAN
U IDENTIFY THE MISTAKE & REASON"
Try
If TextBox1.Text.Equals("jigs") Then
'Do login update in database
Response.Redirect("Page2.aspx")
Else
Response.Redirect("Page3.aspx")
End If
Catch ex As
Exception
'if any errors
Response.Redirect("CommonError.aspx?id=" +
ex.Message)
End Try |
|
| Dry run the following and tell me the output with reason.
dotnetjini Pvt Ltd already has a class as below
( joljal.dll )
public class joljal
{
public static readonly string READONLY = "JIGS
is the";
public const string CONST = "BEST in .NET";
}
an dotnetjini application uses this class
( MyApplication.EXE )
public class MyApplication
{
public static void Main()
{
System.Console.WriteLine(joljal.READONLY);
System.Console.WriteLine(joljal.CONST);
}
}
STAGE#1:: Run Exe --> What is the Output ?
There was a change required in the DLL, following where the changes
applied.
( joljal.dll )
public class joljal
{
public static readonly string READONLY = "ya
I am also not so";
public const string CONST = "WORST in .NET";
}
Compiled with csc and new DLL created
STAGE#2:: Run Exe --> What is the Output ?
What's the output of Stage#1 and Stage#2 , convince your answers with
reasons.
Anyone first with compelling answer will get one DAIRYMILK from
me when we meet at session.
|
|
|
|
|
|
|
|
|
|
|