8933 0
Converting JSON to XML OR XML to JSON using C#
In this article, I have provided working sample to convert JSON to XML OR XML to JSON using C# with an working example.
Type
Article
8638 3
How to remove server headers from IIS in ASP.NET MVC easily, need step by step guide?

How do I remove unnecessary HTTP Headers in IIS and ASP.NET application simply, please provide me step by step tutorial for improving security in this area?

I have already googled this and found few solutions but I need an easy tutorial, which can guide me to remove all unnecessary HTTP Headers from Response.

Any link or step by step guide will work.

...
Type
Question
8573 2
Error "illegal characters in path" C#

Hello, I am trying to save file in C#, using file.SaveAs(Path), and getting the error "Illegal Characters in Path" as shown below

...

Type
Question
8494 1
How to get latitude and longitude from address using C# or Javascript?

I have a requirement to get latitude and longitude from address using C# or Javascript, any solution will work. So, how can I get them using address?

Basically, I need to convert the address into Lat / Long and show it in Google maps in ASP.NET MVC web-application, so javascript solution will also work.

Note: I don't have lat/long, just address of the user.

...
Type
Question
8434 0
How to add a item or multiple items in C# List
In this article, I am going to provide you example to create list and add items in list in C# and how to add multiple items at once in list.
Type
Article


8425 0
Asynchronous programming in C# and ASP.NET MVC ( With example )
In this article, I have explained about the async-await keyword in C# and how to use asynchronous programming in c#, explained with console application sample.
Type
Article
8142 2
how to convert UTC DateTime to local datetime in C#?

I want method which returns the string datetime in target locale format by taking the UTC DateTime and UTC DateTime offset in c#, here is the example code

 

...
Type
Question
7998 3
how to convert datetime from one timezone to another in C#?

I am working on a C# project in which user can change datetime column time zone using its profile page. For example, when I log in into the system, I can change default time zone (PST) to Indian standard time(IST) after doing all the column of date time should show time-related to IST time zone.

Basically, we are saving all the datetime value in the database as PST time zone, now based on user-selected time zone I need to show datetime.

So I would like to convert my PST datetime (8/16/2016 12:56 PM) to IST or any other timezone selected by user dynamically using C#.

How can I convert datetime from PST to any time zone using C#?

...
Type
Question
7909 0
Understanding C# Classes and Objects with example
In this article, I will provide you proper details for understanding C# classes and objects with the example using Visual Studio console application.
Type
Article
7803 3
Getting error "Sequence contains no elements"

Hello, I am using the below code to fetch some data from database and getting the error "Sequence contains no elements"

 public static IEnumerable<CompanyLicenseKey> GetCompanyLicenseKey()
{
            OPEntities onepassDB = new OPEntities();

            //Let's get the onepass User model first
            var user = onepassDB.UserAccounts.Where(x => x.Email == OnePassUserAccountEmail).First(); //error in this line

            var userLicenseList = from c in user.CompanyProfiles
                                  join l in onepassDB.CompanyLicenseKeys.Where(x => x.IsDisabled == false)
                                  .Select(x => new { x.CRMID, x.LicenseKey, x.FriendlyName, x.ProductName })
                                  on new { c.CRMID } equals new { l.CRMID }
                                  select new Models.OnePass.CompanyLicenseKey { LicenseKey = l.LicenseKey, FriendlyName = l.FriendlyName, ProductName = l.ProductName };

            if (ProductName == "")
                return userLicenseList.ToList().OrderBy(x => x.FriendlyName);
            else
                return userLicenseList.Where(x => x.ProductName == ProductName).ToList().OrderBy(x => x.FriendlyName);
        }

Error image

...

Type
Question

Page 9 of 24