6981 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
9327 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
5354 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
14277 3
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
12033 2
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


5074 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
7978 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
4283 2
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
3711 1
Remove duplicates from datatable in C#

Hello

based on this

https://www.technical-recipes.com/2017/obtaining-combinations-of-k-elements-from-n-in-c/#comment-52343

I create my data and I store them in a datatable.

Now I have another datatable which I fill it from my database.

I need to remove the duplicates from the first datatable and fill a datagridview.

This is what I have so far

...
Type
Question
1895 1
How to catch exception in log parser(MSUtil) though SSIS Package while inserting log file data to table?

I am using LogParser tool (MSUtil dll) to insert data in db through SSIS Package.

I am using following code in script task component:

Looping through log files and using following :

 

...
Type
Question

Page 15 of 24