Code reusability is very important in the software development process. We can save time and resources and reduce redundancy by using the code that have already been written. Continue reading “Creating a class library with C# and .NET Core in Visual Studio Code and how to use in another project”
Category: C#
Step by step Installation of C# Extension in Visual Studio Code
C# Extension for Visual Studio Code provides lightweight development tools for .NET Core. By default it includes C# editing support, Syntax Highlighting, IntelliSense, Go to Definition feature etc. You need this extension if you are working with .net core in visual studio. Continue reading “Step by step Installation of C# Extension in Visual Studio Code”
Creating a Hello World application with C# and .NET Core in VS Code
Microsoft .Net core is a free, cross platform, fast, lightweight open-source managed framework for building applications and services that can be run/published on Windows, Linux and Mac operating systems. Continue reading “Creating a Hello World application with C# and .NET Core in VS Code”
Create shortcut of the executable programmatically using c#
The following code snippet demonstrates that how can you create a short cut of any windows application executable programmitically using C#. Continue reading “Create shortcut of the executable programmatically using c#”
Create or open text file to write the text in c#
If you want to to create a text file and write the text and if the file already exist then just append the text in the new line using C#, you can use the following code snippet in c#. Continue reading “Create or open text file to write the text in c#”
Writing and reading cookies in ASP.net using c#
A cookie is just a little bit of text which is send by the browser each time with the request for the page. Each time on the machine when browser will make the request to the web page, it will send the existing cookies along with the request too. So this approach helping the Web site or web application remember users and other information such as user’s preferences, shopping cart contents and the user’s session. Continue reading “Writing and reading cookies in ASP.net using c#”
MVC 4 Exercise-1: Bind dropdownlist based on what is selected in another dropdownlist
Introduction: Create a MVC 4 page that will contains two dropdownlist controls. The first dropdownlist will be for State list and second will contains the City list on the basis of the selected state. Continue reading “MVC 4 Exercise-1: Bind dropdownlist based on what is selected in another dropdownlist”
Keep ‘\r\n’ in XML Serialization and Deserializtion in C#
The following example shows to keep the \r\n characters in the string after Serialization and Deserializtion.
Generally when you serialize an object with a string value that contains ‘\r\n\’ (Carriage Return and new line characters in string) and after deserialize it than in the outcome ‘\r’ is disappeared. Suppose if you string is ‘5 Avenue \r\n North road’, the string comes after deserialize as ‘5 Avenue \n North road’. Continue reading “Keep ‘\r\n’ in XML Serialization and Deserializtion in C#”
Create new DataTable from the DefaultView of the another DataTable
The following article demonstrates how to create new DataTable from the DataView or DefaultView of another DataTable. The general requirement for doing this is that once you have retrieved DataTable from a data source and than you may need to sort or filter the data without retrieving it again. You can use the ToTable() method that creates and returns a new DataTable object based on rows in an existing DefaultView of the DataTable. Continue reading “Create new DataTable from the DefaultView of the another DataTable”
Create JSON string from the Dataset in C# and VB.Net
In this post I am describing a example by which you can create the JSON string from the datatable object. After creating the JSON from the datatable, You can use it on the client side through the JavaScript. Continue reading “Create JSON string from the Dataset in C# and VB.Net”