Category "c++sharp"

Export to Excel for telerik radgrid

I want to export current date along with radgrid data to the excel sheet. How can I do this? For exporting radgrid I am using following code: public void Expo

Check if a record exists in the database

I am using these lines of code to check if the record exists or not. SqlCommand check_User_Name = new SqlCommand("SELECT * FROM Table WHERE ([user] = '" + txtBo

AutoMapper convert from multiple sources

Let's say I have two model classes: public class People { public string FirstName {get;set;} public string LastName {get;set;} } Also have a class Phone:

Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1

using System; using System.Collections.Generic; using System.Linq; using System.Text; using Facebook; using Newtonsoft.Json; namespace facebook { class Pro

C# Moq: How to I create a create a Mock that returns the input with a field adjusted

I am trying to mock a sub-process for my tests. I know I can return the input to the function I am mocking as such: Mock<MockedObject> mock = new Mock<

Monitor.TryEnter doesn't work

Part of my code-behind: object _sync = new object(); private async void OnKeyDown(object sender, KeyEventArgs e) { if (!Monitor.TryEnter(_sync)) return;

Dynamically add Image into asp.net c# gridview

I would like to display image inside a gridview. My gridview is being filled like This: Front: <asp:GridView ID="GridViewProduct" runat="se

Modifying Outlook 2010 autocomplete stream

I am accesssing the Outlook 2010 cache using the below code and modifying it. Please let me know how i can udpate the entry back to inbox mail store. Microsof

How to replace a char in string with an Empty character in C#.NET

I have a string like this: string val = "123-12-1234"; How can I replace the dashes using an empty string in C#. I mean val.Replace(char oldChar, newChar);

How to parse this json result without making class in C#

How can i parse this json without class in c#. I don't know what to use either an array or anything else. This is the json result i want to be parsed { "s

How to solve the error "Must use PackageReference"?

After adding WindowsRuntime to a WinForms-project, building the project fails with Error "Must use PackageReference". The build log is more precise: C:[...]\Vi

Opening/Closing a Database connection in an apsx page for an IVR system

I am currently developing an IVR system, my question is more on a development side of basic architecture and opening/closing a database connection. As you can

Using block galore?

I'd like your opinion on the following subject: Imagine we have a method that is responsible of achieving one specific purpose, but to do so, it needs the supp

Form within a foreach loop not posting the model back to the controller

I've searched around and can't find an answer to my problem. I've got a View that takes accepts Foo in like so: @model IEnumerable<MyApplication.Models.Foo

How can I obtain a vertical bar that fills, like a progress bar?

As the title says I'm trying to obtain a vertical a bar and fill it depending on values. I couldn't apply any answers I found. One answer suggested replacing Sy

xUnit shared context by private static fields

What disadvantages have an approach of sharing context by creating private static fields? If I don't need to call Dispose? public class MyTests3 : IDisposable {

Reset part of application settings

So, I have Form called Preferences with TabControl in it. This TabControl contains several TabPages(General, Advanced, Misc, ...) with few comboboxes, checkboxe

How to set json serializer settings in asp.net core 3?

json serializer settings for legacy asp.net core applications were set by adding AddMvc().AddJsonOptions(), but I don't use AddMvc() in asp.net core 3. So how c

onclick method not working in Blazor server-side razor component

I am building a sample razor component, and I can not get my button onclick method to fire. When I click the button nothing happens at all. I have even placed a

How to fire click event of the LinkButton in gridview and Show PopUp window in asp.net

I have tried to build one gridview with dynamic columns based the data source using the template fields in asp.net through code behind. For that, to implement