278 1
There is already an open datareader associated - error in C#

I am trying to run a below query in my ASP.NET MVC project, but I am getting an error "there is already an open datareader associated with this command which much be closed first" in C#, how can I resolve it?

datareader-alread-open-C-sharp-min.png

Here is the C# code, which I am using

...
Type
Question
C# c# sql datareader already open c# sqldatareader already open
266 1
How to create dynamic list type in C#?

Hello, I would like to create a helper function in the class, which can be used by multiple List types at the same, so how can I create initialize or create function to pass List<T> where T can be any type of class in C#?

...
Type
Question
C# dynamic list type
240 0
How to read and write in Console app using C#?
In this article, I have explained how to read and write in C# console applications using Console.ReadLine(), Console.WriteLine() methods in C# for basic, input and output using Console.
Type
Article
C# c# print to console c# print to console example c# read and write to console
229 1
How can I run raw SQL query in C#? ( With and Without ADO.NET)

I am trying to optimise my query to get data from database, so I would to know how can I directly run a sql query in my C#.

Currently I am using Entity framework with EDMX, so to improve query time, I would like to know how can I run direct sql query?

...
Type
Question
C# ASP NET SQL query in C#
224 0
Various star pattern program in c#
In this article, I have show example of various star pattern programs in C# with code and there output.
Type
Article
C# star pattern program in c# star pyramid program in c# pyramid pattern in c# program to print triangle of stars in c#

203 1
How to check if I am using localhost server or not in C# MVC?

I am trying to create a background job using hangfire as explained in this article "Background jobs in ASP.NET MVC C# using Hangfire.io" but I don't want to run this background jobs when working locally.

So, How can I check if I am on localhost in C# & ASP.NET MVC and not run this background jobs?

...
Type
Question
C# check if i am on localhost
198 0
Read file in C# ( Text file example using Console Application )
In this article, I have explained and provided code to read text file in C# ( line by line or complete text file into string) using Console application example.
Type
Article
C# c# read file c# read text file
181 0
How to get file extension or file size in C# ? ( Code With Example )
In this tutorial article, I have provided sample code with examples, which shows how to get file extension from file name and file size in C#
Type
Article
C# c# get file extension file extension c# file extension get file extension from file name c#
81 0
Barcode generator in C# ( and how to read barcode )
In this article, I have provided sample code, which you can use in C# MVC or Win-Form or any other C# app to generate barcode Type 128 / UPCA/ 11 and read barcode in C#.
Type
Article
C# c# barcode generator barcode generator c# source code
48 1
LINQ to Entities does not recognize the method 'System.DateTime Parse(System.String)' method

I am getting an error "System.NotSupportedException: LINQ to Entities does not recognize the method 'System.DateTime Parse(System.String)' method and this method cannot be translated into a store expression." when trying to run below code in C# ASP.NET MVC

...
Type
Question
C# entity-framework linq-to-entities

Page 13 of 14