2017 - Coding Sharp

Year: 2017

Explore the SQL Server Cursors basics

SQL Server
Cursor is the database object in MS SQL Server to retrieve the data from the result set one row at a time either in backward direction or forward direction. Generally in T-SQL command it will direct operates on all the rows of result at one time, so when ever we want to process based on the condition 1 by 1 for our process or data is dependent on the previous actions cursor is the suitable feature to use. Now lets see the Life cycle of the cursor as below Declare the cursor Like any other object we need to declare the cursor first, we can declare the cursor by defininf SQL statement which returs a result set. Open the cursor Once cursor is declared we can open and populate by executing the SQL statement defined in the cursors. Fetch records one by one from the Cursor One cursor is...
Serialization & Deserialization using JSON In C#

Serialization & Deserialization using JSON In C#

Asp.Net, C#.Net, JSON
Introduction The very useful method of converting JSON object to .Net object and .Net object to Json object is using the JsonConvert. It converts Json objects to .Net object and with the Same property with value and .Net objects to equivalent JSON object. In this article we will see how to serialize .NET type objects into JSON object and then deserialize data in the JSON format back into .NET types using the JsonConvert class. What is JSON? JSON (JavaScript Object Notation) is one lightweight and efficient data exchange format or we can say like JSON is most desirable data encoding format which allows fast exchanges of small amounts of data between client browsers and web services or web api. JsonConvert JsonConvert class is in the namespace "Newtonsoft.Json" and for this...
Easiest way to find row count of each tables in a MS-SQL Database using  Queries

Easiest way to find row count of each tables in a MS-SQL Database using Queries

SQL Server
Introduction I was working in a project where I need to compare my Production database and Staging database each time I upload code to the production server. Being developer it is tedious task to check manually for each table in source and target database as it is taking more time. Using script/query which can get the number of rows from all the tables in selected database can be really effective. So I was thinkg to check it using query where we can run the query again each database and it returns name of the table and number of rows for each table. I have prepared a script for that and now let me share that query with my blog readers in this article. In SQL Server there are tables called sys.tables, sys.sysindexes and many others like this, which stores table related data and all...

Process with an ID #### is not running in visual studio community edition 2015

Special Posts
Today I was working on a project and my team member has push the changes to repository first time and I get the latest from git. When I tried to run the project I get an error like "Process with an ID #### is not running". It's showing Id number different every time. If I check the error window It showing me an error like below "The program '[3148] iisexpress.exe' has exited with code -1073741816 (0xc0000008) 'An invalid handle was specified'." In browser it's shows me message like "The webpage is not available." I have tried different different solutions and check but non of them fixed my issue. After googling I found some different different solution and finally 1 solution worked for me. So let me show you how to resolve that issues in visual studio. Solution 1. Cl...

SQL Server Interview Question and answers

SQL Server
If you are going for an SQL Server Interview or .Net interview then you need to refer below list of questions. Below question and answer will give you a break through. Here I have prepare some simple and tricky questions for SQL Server which will really help you to go through the interview. 1. What is the difference between clustered and a non-clustered index? - Clustered index is the physical index, It reorders the records physically in the table while storing the data. - Non-Clustered index is the logical index, It does not reorders the data into table, it's just set the logical order of the index. 2. What is the difference between UNION and UNIONALL in SQL Server? - Union and Union All both are used in select statement, Union will remove the duplicate rows from the final result s...
Interview Questions and Answers for ASP.NET MVC

Interview Questions and Answers for ASP.NET MVC

Asp.Net MVC, C# Interview
Nova days ASP.NET MVC is getting more and more popular. ASP.NET MVC has a very good feature called Modal-View-Controller architecture so it is more popular. In this article we will see the some Question and Answer for ASP.NET MVC which will help you to make your asp.net mvc concept clear in short time. We will keep posting more and more article in this interview series so this will be your unique place to find interview related questions answer. Now let's start some important interview question answer related to ASP.NET MVC. 1. What is ASP.NET MVC ? Most commonly asked question in the interview, ASP.NET MVC is an architectural pattern which separates the UI and code. Mainly it's divided into 3 Parts Model, View and Controller. -Model : Model is a real word object, (Database table) ...
Process with an ID #### is not running in visual studio community edition 2015

Process with an ID #### is not running in visual studio community edition 2015

Asp.Net, Asp.Net MVC, C#.Net
Today I was working on a project and my team member has push the changes to repository first time and I get the latest from git. When I tried to run the project I get an error like "Process with an ID #### is not running". It's showing Id number different every time. If I check the error window It showing me an error like below "The program '[3148] iisexpress.exe' has exited with code -1073741816 (0xc0000008) 'An invalid handle was specified'." In browser it's shows me message like "The webpage is not available." I have tried different different solutions and check but non of them fixed my issue. After googling I found some different different solution and finally 1 solution worked for me. So let me show you how to resolve that issues in visual studio. Solution 1. Cl...
Explore the Use of System.Environment Class

Explore the Use of System.Environment Class

Asp.Net, Asp.Net MVC, C# Interview, C#.Net
System.Environment class can not be inherited. It provides valuable information about current platform and environment of the system. It uses to retrieve environment variable settings, version of the CLR and call stack contents etc. It has various methods and property to get the useful information about current working environment. Lets have a look on some of most used properties. Get the Machine Name - To Get the current system's machine name we can use MachineName property of Environment class. For example : Console.WriteLine("Machine Name :" + Environment.MachineName); Get the Current Working Directory - To Get the current working directory we can use CurrentDirectory property of Environment class. For example : Console.WriteLine("Current Directory :" + Environme...
What is the Difference between Build, Rebuild and Clean in Visual Studio?

What is the Difference between Build, Rebuild and Clean in Visual Studio?

Asp.Net, Asp.Net MVC, C# Interview, C#.Net, Difference
If you are a Microsoft Asp.Net Developer then usually you came across this words like Build, Rebuild and Clean. This article gives you explanation about Difference between Build, Rebuild and Clean If you are using Visual studio you might have question that what is difference between Build, Rebuild and Clean ? here we are going to understand the diversity between them. Build Solution : When we build any solution then Visual studio will build/compile all assemblies (Dlls and EXE's) that are changed, it is basically incremental or partial process in which only CHANGED assemblies are compiled if there is no changed assemblies it won't get build Rebuild Solution: It is full compiled case, in which all assemblies (either changed or not) are deleted and recompiled again, irrespect...
Difference between .Net DLL and Normal DLL file

Difference between .Net DLL and Normal DLL file

Asp.Net, Asp.Net MVC, C# Interview, C#.Net, Difference
DLL is stands for Dynamic Link Library. DLL is a file format which holds multiple codes and procedures for windows applications. Generally DLL files are created so that multiple application can use it at the same time. It has common code which may be used by multiple programs so it can reduce the disk space, load faster and consume less memory. DLLs can be converted to static libraries by using MSIL (Microsoft Intermediate Language) diassempler. It is very similar to .EXE file but it can not be execute directly like EXE, but holds same information like code, data and resources. What is .NET dll file? When we create a .NET DLL or Assemply in .Net Languages like VB.Net or C#.Net it will create a Managed Assembly. Managed Assembly is the component standard specified by Microsoft .Net. S...