Pages

Friday, July 27, 2018

Create dotnet core console application using Visual Studio code from the command prompt

Prerequisites:

.NET core and Visual Studio Code setup is completed.

To cross check if  .NET core is installed and path is configured type

>dotnet --version 

in the command prompt







Returning the version indicates that the dotnet core was successfully installed.

.NET CLI --It is the tool which is used for creating the console application i.e scaffolding ,debugging and building the console application.

Create HelloApp

There are multiple ways to create the console application.

In the command prompt , run the following command

>dotnet new console -o HelloApp




The dotnet command creates a new application of type console.The -o parameter creates a dircetory named HelloApp where your app is stored and populates it with the required files.

The HelloApp has Program.cs file when run prints Hello world on console.

Nvaigate to HelloApp from command prompt using the following command 

> cd HelloApp








Run the Application

Run the application using the command 

>dotnet run

 to see the output Hello world!







Open the App in Visual studio code editor
-----------------------------------------------------
To open the project in the visual studio code editor from the command prompt type the following command

>code .






Congratulations on your first .NET core console application :) .Happy Coding!

Thursday, July 26, 2018

Comment mutiple lines of code in the visual studio code


Following is the way to comment multiple lines of code in the visual studio  code

Shift+alt+a

All the VS code shortcuts can be found at VS keyboard shortcuts

Duplicate a line or selection within Visual Studio Code in windows


Following is the way to open duplicate a line or selection in the visual studio  code

Shift+alt+down and shift+alt+up

The associated keybindings can be seen by navigating to : File > Preferences > Keyboard Shortcuts from the menu 

Format or beautify code in Visual Studio Code


Following is the way to format the or beautify the code in the visual studio  code

 1)Use the shift+alt+f keyboard shortcut on Windows .
 2)Use the shift+option+f  keyboard shortcut on Mac.

How to open terminal in Visual studio Code


Following is the way to open the terminal in the visual studio  code

 1)Use the Ctrl+` keyboard shortcut.
 2)Navigate to View -> Integrated Terminal menu command.
 3)From the Command Palette (Ctrl+Shift+P), use the View:Toggle Integrated Terminal command.

How to stop or terminate node server

To terminate or to stop node server from the command prompt press CTRL+c

Press y to terminate or to stop the server

Saturday, August 13, 2016

Eliminate merged and hidden Cells issue from Excel Export of a SSRS report

While working on SSRS reports , i have encountered the merge cell issue when exporting to excel  as shown below



To resolve this all i had to do was ,

1.  Make sure that while designing the report in the report layout, all the report’s rows (header row as well data rows) should start at (0,0) location and there is no additional space on the left-hand side of the report in the design layout. This can be
done by making the Left and Top values under the Location section in the properties window, 0



2.I have removed the header completely as I was using controls like textbox etc which were the root cause for the merge issue.
3.For header names , i have created a parent group with a group name and formatted it in such a way that it looked as a header.I have set the properties such that the header names repeated on each and every page.

WPF:The name does not exist in the namespace error in XAML



When i encountered this problem i have deleted .suo file and restarted my visual studio.Later i rebuilt the solution .The error was gone.

WPF:Dynamically resizing a window in Xaml



Set SizeToContent="WidthAndHeight" on the window and the window will dynamically resize based on its content size.




WPF: .exe does not contain a static Main method suitable for an entry point



This morning while running my WPF application, I ran into the following error: " .exe does not contain a static Main method suitable for an entry point"

If you are getting the same error the solution is simple, you need to make sure that the "Build Action" from App.xaml file for your application is set to "ApplicationDefinition".
Hope this helps somebody out there.



Sunday, June 21, 2015

#deepstutorials:How do I get the value of a textbox using jQuery

The following code creates a form with a textbox

 <html>
<body>
<form>
First name: <input type="text" name="FirstName" id="firstName"><br>
Last name: <input type="text" name="LastName" id="lastName"><br>
<input type="submit" value="Submit">
</form>
<body>
</html>

 To access textbox using jquery ,following is the way
var firstName= $('#firstName').val();  //
$("#firstName").val("someValue")//Is used to set the value of textbox

Saturday, June 20, 2015

#deepstutorials: how to get the value of a textarea in jquery?


The following code creates a form with a textarea

<html>
<body>
<form action="demo_form.asp">
<textarea rows="4" cols="50" id= "comment" name="comment">
Enter text here...</textarea>
<input type="submit">
</form>
</body>
</html>
 


To access textarea using jquery ,following is the way
var message = $('comment').val();

Tuesday, May 12, 2015

#deepstutorials:Horizontal tab navigation in bootstrap


The following code creates a horizontal tab navigation using bootstrap as shown below

<html lang="en">
<head>
  <title>Bootstrap Example for horizontal tab navigation</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
  <h2>horizontal Navigation Pills</h2>
<ul class="nav nav-tabs" role="tablist">
    <li class="active"><a href="#">Home</a></li>
    <li><a href="#">Women</a></li>
    <li><a href="#">Men</a></li>
    <li><a href="#">kids</a></li>        
  </ul>
</div>
</body>
</html>

horizontal Navigation in bootstrap.Focus is on Home tab as we have set active to class attribute of "home" anchor

#deepstutorials:Bootstrap breadcrumb example

The following code shows example to use bootstrap "breadcrumbs" to create a wizard like workflow.


<html lang="en">
<head>
  <title>Bootstrap Example for breadcrumb</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
    <p>The .breadcrumb class indicates the current page's location within a navigational hierarchy:</p>                  
  <ol class="breadcrumb">
    <li><a href="#">Home</a></li>
    <li><a href="#">Clothing</a></li>
    <li><a href="#">Women</a></li>
    <li class="active">Hand bags</li>        
  </ol>
</body>
</html>
The .breadcrumb class indicates the current page's location within a navigational hierarchy.Curently,we are at "hand bags" page whose label is in "grey color".The .active class indicates that it is on the current page.

Saturday, May 9, 2015

#deepstutorials:Writing tooltips in bootstrap

The following code shows example to use bootstrap tooltip.

<html lang="en">
<head>
  <title>Bootstrap Example for tooltip</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
    <ul class="list-inline">
    <li><a href="#" data-toggle="tooltip" data-placement="top" title="tooltip on top!">Tooltip Top</a></li>
    <li><a href="#" data-toggle="tooltip" data-placement="bottom" title="tooltip on bottom!">Tooltip Bottom</a></li>
    <li><a href="#" data-toggle="tooltip" data-placement="left" title="tooltip on left!">Tooltip Left</a></li>
    <li><a href="#" data-toggle="tooltip" data-placement="right" title="tooltip on right!">Tooltip Right</a></li>
  </ul>
</body>
</html>

Bootstrap example for tooltip

Friday, April 24, 2015

deepstutorials:Creating basic menu drop down using bootstrap

The following code creates a  basic drop down as shown below

<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
 <div class="dropdown">
  <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown Menu
  <span class="caret"></span></button>
  <ul class="dropdown-menu">
    <li><a href="#">Menu item 1</a></li>
    <li><a href="#">Menu item 2</a></li>
    <li><a href="#">Menu item 3</a></li>
  </ul>
</div>
</div>
</body>
</html>

Basic Drop down  in bootstrap

deepstutorials:glyphicon bootstrap usage example


The following code creates an example to illustrate glyphicons.More glyphicons can be found at glyphicon website

<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
  <h2>Glyphicon Examples</h2>
  <p>Envelope icon: <span class="glyphicon glyphicon-heart"></span></p>    
  <p>Envelope icon as a link:
    <a href="#"><span class="glyphicon glyphicon-heart"></span></a>
  </p>
  </div>
</body>
</html>

Glyphicon Examples

Envelope icon:
Envelope icon as a link:

deepstutorials: Vertical Navigation in bootstrap


The following code creates a vertical navigation using bootstrap as shown below

<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
  <h2>Vertical Navigation Pills</h2>
   <ul class="nav nav-pills nav-stacked" role="tablist">
    <li class="active"><a href="#">HTML</a></li>
    <li><a href="#">CSS</a></li>
    <li><a href="#">Jquery</a></li>
    <li><a href="#">Bootstrap</a></li>        
  </ul>
</div>
</body>
</html>

Vertical Navigation in bootstrap

deepstutorials:Vertical button group bootstrap


The following code creates a button group as shown below

<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
  <h2>Vertical Button Group</h2>
  <div class="btn-group">
    <button type="button" class="btn btn-primary">ButtonGroup1</button>
    <button type="button" class="btn btn-primary">ButtonGroup2</button>
    <button type="button" class="btn btn-primary">ButtonGroup3</button>
    <button type="button" class="btn btn-primary">ButtonGroup4</button>
  </div>
</div>
</body>
</html>

Vertical Button Group

Thursday, March 12, 2015

deepstutorials: Bootstrap expand/Collapse Plugin



Bootstrap plugin is  used to create expandable/collapsible Panels.Below is the code

<div class="panel-group" id="accordion">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h4 class="panel-title">
        <a data-toggle="collapse" data-parent="#accordion" 
          href="#collapse1">
         Section 1 Content.Click me to expand.Click again to collapse
        </a>
      </h4>
    </div>
    <div id="collapse1" class="panel-collapse collapse in">
      <div class="panel-body">
      Section 1 Content.Click me to expand.Click again to collapse.
      </div>
    </div>
  </div>
  <div class="panel panel-default">
    <div class="panel-heading">
      <h4 class="panel-title">
        <a data-toggle="collapse" data-parent="#accordion" 
          href="#collapse2">
      Section 2 Content.Click me to expand.Click again to collapse.
      
        </a>
      </h4>
    </div>
    <div id="collapse2" class="panel-collapse collapse">
      <div class="panel-body">
       Section 2 Content.Click me to expand.Click again to collapse.
      
      </div>
    </div>
  </div>
  <div class="panel panel-default">
    <div class="panel-heading">
      <h4 class="panel-title">
        <a data-toggle="collapse" data-parent="#accordion" 
          href="#collapse3">
               Section 3 Content.Click me to expand.Click again to collapse.
         </a>
      </h4>
    </div>
    <div id="collapse3" class="panel-collapse collapse">
      <div class="panel-body">
        Section 3 Content.Click me to expand.Click again to collapse.
       </div>
    </div>
  </div>
</div>
 Section 1 Content.Click me to expand.Click again to collapse        
      
Section 1 Content .Click me to expand.Click again to collapse.
Section 2 Content.Click me to expand.Click again to collapse.
Section 3 Content.Click me to expand.Click again to collapse.