Questions




Answers
1
Why does my vscode wont go as tree view?

I am trying to does my vscode wont go as a tree view, if the parent folder has one file (either file or sub-folder), it always append to the main folder.

...

Read More
Answers
2
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

...
Read More
Answers
2
How to send Razor View as a Email with Model in ASP.NET MVC?

I am trying to send email in ASP.NET MVC, but it is not a plain HTML string, I need to convert Razor View with Model into string and then send it as a HTML content in MVC. So, How can I convert Razor view in HTML string with Model and then send it in MVC email? Thanks

...
Read More
Answers
2
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?

...
Read More
Answers
2
How to make a div editable on Click?

I would like to make div editable to enter contents in it and on changing content, want to call ajax to save data in back-end.

I know we can do it using Textbox, but would like to make a <div> inside <td> to make it editable when user clicks inside it.

...
Read More
Answers
0
How to update table variable in stored procedure from another user defined function in sql?

Scenario : User defined function return one table. If that table contains at least one row,one column in the table variable from another sp should get updated.

Should I use cross join on UDF to update table variable?

sql

...
Read More
Answers
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?

...
Read More
Answers
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.

...
Read More
Answers
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#?

...
Read More
Answers
2
How to add custom search box in jQuery Datatable and place it outisde main Table?

I am using jQuery datatable in my ASP.NET MVC website, now I would like to place this custom search box main jQuery datatable, how can I do that using jQuery?

...
Read More

Page 9 of 51