10,452 questions with C#-related tags

Sort by: Updated
3 answers One of the answers was accepted by the question author.

Which is better to use, DbContext.Add() or DbSet.Add()?

Hi, If you allow, I would like to ask a question. In CRUD operations, we can add to the database in two ways: DbContext.Add(object) and DbSet.Add(object). Which one is more correct to use? public class Context : DbContext { public DbSet<Category>…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
710 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2024-06-10T07:02:43.7566667+00:00
Yalçın Mete 0 Reputation points
accepted 2024-06-10T08:12:51.1433333+00:00
Yalçın Mete 0 Reputation points
1 answer

VirtualizingStackPanel Scrollviewer height

I am working a uwp app where i used ListView with VirtualizingStackPanel . In my case i am trying create an alternatives for CVS ListView so each item has a ItemsControl (choosen this because it consume less memory and ScrollViewer). Now if i want…

Universal Windows Platform (UWP)
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
776 questions
asked 2024-05-22T06:12:58.1066667+00:00
shriram 90 Reputation points
edited a comment 2024-06-10T07:44:37.1566667+00:00
shriram 90 Reputation points
1 answer One of the answers was accepted by the question author.

Hi, i want to register my call of duty mobile game and when i manually entered they key the authenticator is looking for the secret key? Where can i get it from?

when i manually entered they key the authenticator is looking for the secret key? Where can i get it from? Thanks

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,987 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,797 questions
Microsoft Intune Configuration
Microsoft Intune Configuration
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Configuration: The process of arranging or setting up computer systems, hardware, or software.
1,767 questions
asked 2024-06-07T17:06:11.8533333+00:00
Lotis Sanchez 20 Reputation points
commented 2024-06-10T05:43:09.5933333+00:00
Lotis Sanchez 20 Reputation points
4 answers

What is the best way to show the loader while uploading the file in gridview

I am using gridview for displaying and inserting new records. i'm using loader wherever it is required in the gridview. it is working fine. i'm trying to use animation loader for specific upload column in gridview. will it possible to show the loader…

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,355 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2024-06-07T17:12:49.2366667+00:00
Gani_tpt 1,986 Reputation points
answered 2024-06-10T04:14:29.17+00:00
Lan Huang-MSFT 27,476 Reputation points Microsoft Vendor
0 answers

How to fix Signature validation failed when trying to validate an access token of Microsoft Entra ID

Hi, I'm trying to validate my access token signature from Microsoft Entra ID, as you can see in the below image, the "kid" attribute is different from the keys retrieved in the second image below that were retrieved from…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,504 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,016 questions
asked 2024-06-07T20:44:34.87+00:00
Bernardo Garza García 0 Reputation points
edited the question 2024-06-10T03:47:07.6633333+00:00
JananiRamesh-MSFT 22,466 Reputation points
1 answer

How to access/Update Group Policy Objects using C sharp

Hi, We are referring below link to access group policies programmatically   using c sharp. https://learn.microsoft.com/en-us/previous-versions/windows/desktop/wmi_v2/class-library/gpo-class-microsoft-grouppolicy This is sample code which we have written…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2024-05-08T07:35:50.82+00:00
commented 2024-06-10T03:37:03.24+00:00
0 answers

Use same VisualStateGroup in all different ListViewItem style

Hello everyone. I'd like to make my VisualStateGroup unique for all ListViewItem, so that any ListViewItem style, even different, can use the same VisualStateGroup, without repeating in the ListViewItem style. Declare the VisualStateGroup once and all…

Universal Windows Platform (UWP)
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
776 questions
asked 2024-06-07T09:38:18.44+00:00
Anderson Rodrigues Cavalcante 271 Reputation points
commented 2024-06-10T03:24:47.9633333+00:00
Roy Li - MSFT 32,646 Reputation points Microsoft Vendor
1 answer

How to hide the modal popup if another modal popup is open in ASP.NET

I am using multiple modal popup window (bootstrap) in the gridview. one is for onclick (link button) second one is for onclick (image button) i have used two different design popup model (dialog). i am facing the issue, when i click linkbutton, it is…

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,355 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2024-06-07T09:43:53.13+00:00
Gani_tpt 1,986 Reputation points
answered 2024-06-10T01:48:10.87+00:00
Lan Huang-MSFT 27,476 Reputation points Microsoft Vendor
2 answers

Make calendar in datagridview c#

Good day! Please take a look the image below. I want to input day from June to July but no color displayed from start to end date. And here my code. int offset = 4; foreach (DataGridViewRow row in dataGridView1.Rows) { …

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2024-06-08T10:06:27.07+00:00
BgnerNprg207 226 Reputation points
edited the question 2024-06-10T01:30:13.3866667+00:00
Tianyu Sun-MSFT 28,421 Reputation points Microsoft Vendor
0 answers

System.Exception: 'Days between ViewStart and ViewEnd should be between 1 and MaximumViewDays' in c#

I want to select multiple days in my monthView1, but the error message say."System.Exception: 'Days between ViewStart and ViewEnd should be between 1 and MaximumViewDays'" and here my code. private void monthView1_SelectionChanged(object…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2024-06-09T06:50:07.66+00:00
BgnerNprg207 226 Reputation points
edited the question 2024-06-10T01:29:03.29+00:00
Tianyu Sun-MSFT 28,421 Reputation points Microsoft Vendor
1 answer

Confused about how to use Microsoft.AspNetCore.SystemWebAdapters while trying to port from old ASP.NET website to new ASP.NET Core web app

https://stackoverflow.com/questions/78589165/confused-about-how-to-use-microsoft-aspnetcore-systemwebadapters-while-trying-to Can some one tell me how to approach this?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,275 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,355 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2024-06-07T21:23:00.4833333+00:00
Sameer Ranade 0 Reputation points
answered 2024-06-10T00:49:04.55+00:00
Bruce (SqlWork.com) 58,936 Reputation points
0 answers

Unable to get access token for microsoft store service

Hi, I am building an app for the Microsoft Store. I require the app's server to connect to the microsoft store to validate purchases. I'm using the Microsoft.StoreServices API provided at: https://github.com/microsoft/Microsoft-Store-Services Basically…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,275 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,032 questions
Microsoft Partner Center
Microsoft Partner Center
A Microsoft website for partners that provides access to product support, a partner community, and other partner services.
897 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,016 questions
asked 2024-06-09T22:08:13.59+00:00
Jacques O 0 Reputation points
edited the question 2024-06-09T22:16:19.2866667+00:00
Jacques O 0 Reputation points
1 answer

Unable to connect to server in Visual Studio 2022

Description of the problem: When trying to connect to a remote server using Visual Studio 2022, I receive the following error: System Information X A service error occurred. I have already searched for help online, but I have not…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,504 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,018 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2024-06-09T20:07:45.0033333+00:00
Roberto C 100 Reputation points
answered 2024-06-09T21:16:06.9766667+00:00
Roberto C 100 Reputation points
1 answer

How to set up WinUI3 applications to run as administrators

I'm begging to write WinUI3 application. Administrator privileges are required for certain functions. In the Win-form program, simply configure the following in the app. manifest <requestedExecutionLevel level="requestAdministrator"…

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
737 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2024-06-07T08:35:00.8433333+00:00
C CB 20 Reputation points
answered 2024-06-09T07:00:55.65+00:00
Castorix31 82,241 Reputation points
2 answers

i can't use sql in winform c#

Severity Code Description Project File Line Suppression State Error CS1069 The type name 'SqlConnection' could not be found in the namespace 'System.Data.SqlClient'. This type has been forwarded to assembly 'System.Data.SqlClient, Version=0.0.0.0,…

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,383 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2022-05-26T00:58:31.467+00:00
aley123 1 Reputation point
commented 2024-06-09T06:05:31.7966667+00:00
Do Thi Phuong Anh 0 Reputation points
1 answer

Get data with post method using webclient

Hello There's a POST sample at the bottom of this page: https://ws.interfax.net/admin.asmx?op=GetAccountPPCardsBalance2 Sample HTTP POST request and response. The placeholders shown need to be replaced with actual values. POST…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,619 questions
asked 2024-05-30T13:11:52.0833333+00:00
StewartBW 565 Reputation points
commented 2024-06-08T23:37:14.52+00:00
StewartBW 565 Reputation points
2 answers One of the answers was accepted by the question author.

CA1416 Warning after upgrading from .NET Framework 4.8 to .NET 8 with Windows Forms

Hello, I recently upgraded my project from .NET Framework 4.8 to .NET 8 and I’m using Windows Forms. Although I’m not getting any errors, I’m seeing some warnings that I would like to resolve. One of the warnings is CA1416, which indicates that…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,862 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,504 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2024-06-08T02:59:37.03+00:00
Roberto C 100 Reputation points
accepted 2024-06-08T20:54:47.2766667+00:00
Roberto C 100 Reputation points
3 answers

convert letters increase by 1

Hello, Mask_range="ABCDEFGHJKLMNPQRSTUVWXYZ" Not allowed I and O NewValue: AA AB AG AH BA **Input** NewValue1: AB AC AH AJ BB **Output** NewValue2: …

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2024-06-06T16:23:59.4166667+00:00
Noah Aas 300 Reputation points
edited a comment 2024-06-08T19:22:20.57+00:00
Viorel 113.7K Reputation points
3 answers One of the answers was accepted by the question author.

PDF File not opening in modal popup in asp.net using embed

I am unable to open the pdf file which is located in file server path through modal popup. pls. find below code. <script type="text/javascript"…

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,355 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2024-06-06T13:53:41.8333333+00:00
Gani_tpt 1,986 Reputation points
commented 2024-06-08T16:55:11.3366667+00:00
Gani_tpt 1,986 Reputation points
1 answer

Queries with EF Core causes 'Cannot continue the execution because the session is in the kill state'

Some EF Core queries are throwing the following error in our code : Cannot continue the execution because the session is in the kill state. Une erreur grave s'est produite pendant la commande actuelle. Les résultats devront être supprimés, le cas…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
710 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,018 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,452 questions
asked 2024-06-07T10:02:04.1466667+00:00
Arthur Menétrey 0 Reputation points
answered 2024-06-07T21:28:42.8333333+00:00
Erland Sommarskog 102.9K Reputation points