63 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#
995 0
Create XML document using C# (Console Application example)
In this article, I have explained, how you can create XML document in C# using Console application, it should work in ASP.NET Web-Forms or MVC, as C# code remains same.
Type
Article
C# create xml file c# create xml document c# xml
101 1
How to make Group by in Linq work with possible null values, in C#?

I am trying to add List.GroupBy(a=>a.ProductType.Name).Select(a=>a.FirstOrDefault()), now here I can have null values for .ProductType or .name so how can I ignore null values in C#, so I can get proper results of GroupBy?

If I am using above query in C#, I am getting error

Object reference not set to an instance of an object

I tried to make it like List.GroupBy(a=>a.ProductType != null ? a.ProductType), but it doesn't work.

...
Type
Question
C# linq
96 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
107 1
How to remove double quotes from string using C#?

I wanted to remove double quotes from a string using C#, How can I do that easily and efficiently?

For Example, I have string : "-10,20", how to get output -> -10,20

 

...
Type
Question
C# remove double quotes string

171 1
How to convert a positive number to negative number and negative to positive in C#?

Hello, I would like to know, How can I convert a positive number ( int type) to a negative number in C# and vice-versa ( negative to positive number using C#)?

 

 

...
Type
Question
C# positive-to-negative-int negative-to-positive-int
402 0
Extension Methods in C# (Explanation With Example)
In this article, I have explained about extension methods in C# with an example which helps us to re-use the same C# method at different parts of code.
Type
Article
C# c# extension methods c# extension extension method
1131 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
C# c# await async await c# asynchronous programming c#
725 0
Serialization & Deserialization in C# With Console application example
In this article, I have explained the concept of Serialization & Deserialization Class object in C# with an working console application example.
Type
Article
C# serializable c# c# serialize object serialization in c# example
257 1
How to delete a file, after checking if it exists or not using C#?

I would like to know, how can I delete a file, after checking if it exists on the hard disk, if yes, then delete it, using C# in asp.net?

Thanks

...
Type
Question
C# ASP.NET Delete a file using C#

Page 1 of 12