Posts

Showing posts with the label C#

Reading NS records in C# using ARSoft packages

In this post you will learn about reading NS records in C# using ARSoft packages. This package is handy to read domain NS records. Here's a sample code which will help: using System; using System.Linq; using ARSoft.Tools.Net; using ARSoft.Tools.Net.Dns; namespace ConsoleApp14 {     class Program     {         static void Main(string[] args)         {             var dnsMessage = DnsClient.Default.Resolve(DomainName.Parse("learninhindi.com"), RecordType.Ns);             var nsrecords = dnsMessage.AnswerRecords.OfType<NsRecord>();             foreach (var record in nsrecords)             {                 Console.WriteLine(record.NameServer.ToString().TrimEnd('.'));             }             Console.ReadKey();         }     } } Here's the output of the above code: amit.ns.cloudflare.com fiona.ns.cloudflare.com Hope this helps.

Comparing two List to find match in both list, 1st list only, 2nd list only that is Insersect, Minus and Minus Except

Image
In this code snippet post you will learn how to compare two List<T> using lambda expressions. Below code is simple and self-explanatory if you read: Output:

Upload video on YouTube in ASP.NET or MVC

Image
I n this post you will learn how to upload video on YouTube from your application. I’ve used ASP.NET Web Forms a s well as MVC bits to implement all functionality easily. You can achieve similar functionality ASP.NET Web Forms or MVC a lone .

Write on Existing Image

Image
In this blog post you will learn all about writing text or image on existing image. I will be developing this in ASP.NET Web Forms, but you can achieve this functionality in MVC or windows forms as well. I’ve posted another blog post which generates QR Code . Actually all this was part of my recent requirement which I would like share with you.

QR Code Generation and Verification

Image
In this blog post you will learn all about QR Code, starting from requirement to generation to verification. I am going to develop this in C# and in ASP.NET Web Forms, but you can use it with MVC, Desktop Apps etc. I will be using MessagingToolkit.QRCode open source library for everything here.

Search in selected file types Visual Studio

Image
This is a very important feature which is worth useful when making necessary changes that may match in multiples file types but you are only supposed to change in selective files types.

Initialize var with null or empty in C# - learn workarounds

In this quick code you will learn how to initialize var so that it works like null or empty. Technically, this is not possible.

String Replace by ignoring case C#

Image
This is a quick blog post about replacing string by ignoring case in C#. We land in some situations where we get string and we have no control over case. In such cases to replace string by ignoring its case we can use Regex.Replace method.

Crop image maintaining aspect ratio in ASP.NET, C#

Image
Sometimes we need to decrease size of the images by maintaining aspect image ratio. The code give below will produce a new image from source image and new image will look exactly like source image.

Hidden Input HTML control with jQuery, ASP.NET and C#

In this post you will learn use of Hidden Input HTML control < input type ="hidden"....> with jQuery, also using this from ASP.NET and C#.

Quick Search, Replace and Navigate in Visual Studio IDE (A Must Read Post)

Image
I would call this post as Tips/Tricks post because this post contains information about Visual Studio IDE features. I can see large number of developers are not familiar with these features. So, I thought writing a blog post collecting searching, replacing and navigating tips which is vital to happy and productive.

Normal LINQ Query to Compiled LINQ Query to Auto-Compiled LINQ Queries in Entity Framework 5

Entity Framework 5 brings number of improvements and query performance improvement is one of them. In this article I’ll be talking all on query performances (EF1 to EF5) so that you can understand the improvements better.

Code First Database Migrations in MVC: in Hindi

Image
In this video you will learn how to use Migration feature in MVC Apps. I will create a new MVC Project using Code First Approach and then I will make some changes in model to look at the errors and then will use the Migration feature to migrate/update the database. Video is in Hindi Language.

Using Stored Procedure & Entity Framework in MVC 4 to create CRUD Apps: in Hindi

Image
In this video you will learn how to create CRUD Apps in MVC 4 using Stored Procedure and Entity Framework.

The type 'System.Data.Objects.ObjectContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Today, I was developing an web application, I got titled error. I decided to post the fix for this.

ASP.NET Session States in SQL Server Mode (Session State Story)

Image
A session is defined as the period of time that a unique user interacts with a Web application. Active Server Pages (ASP) developers who wish to retain data for unique user sessions can use an intrinsic feature known as session state. Programmatically, session state is nothing more than memory in the shape of a dictionary or hash table, e.g. key-value pairs, which can be set and read for the duration of a user's session.

Free ebook: Beginning LINQ

Image
A new fashion to write Queries and address the impedance mismatch between programming languages and database. This e-book is based on my series of LINQ posts and I’m just consolidating all blog posts here. Get it Now PDF Version Download Size: 1.10 MB Total Pages: 36 Written  by Abhimanyu Kumar Vatsa ( itorian.com ) and Edited By: Deepak K Gupta .

Learn .NET and C# in 60 Days Video Series : by Shivprasad Koirala

Friends, recently I subscribed a YouTube channel to boost-up my .NET and C# skills by just watching videos. These videos are being recorded by our start tech leader ‘Shivprasad Koirala’ sir ( http://www.questpond.com ). I recommend you to go and subscribe the channel to receive the upcoming videos in your inbox and even watch the uploaded videos that is already recorded. I watched all of the recordings and eagerly waiting for new alert in my inbox.  LearnDotNet60days

Properties in C# : How/Why we use this?

Image
Again, one of my follower on Facebook asked me a question, here it is. Hello Sir I'm new in C#, i tried lot to understand the get/set properties but still can't understand. Please help, why and how we use this? by Manish Kumar And this blog post is my response to his ask. So, let’s get started.

Calling an ASP.NET C# Method (Web Method) using JavaScript

Image
Another title of this post would be “Say bye-bye to Postbacks”. Sometimes we need to stop annoying post-backs on ASP.NET Web Pages. For example, when one click the ASP.NET button on webpage, by default page gets post-back. So, how we stop this by keeping proper code-behind method calls. Let’s look at one case.

Popular posts from this blog

Migrating database from ASP.NET Identity to ASP.NET Core Identity

Customize User's Profile in ASP.NET Identity System