11,317 questions with C#-related tags

Sort by: Updated
2 answers

Why in winforms, after form resize does 'screen.getworkingarea( this) .height' return the same value

Attempting to draw a grid on a winforms form. Draws ok. If I resize the form at all the screen.getworkingarea returns the original values and redraws the grid to the same size with the resized section blank. Having stepped through the code I can see…

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.
11,317 questions
asked 2025-02-20T11:26:07.8533333+00:00
Peter Reilly 0 Reputation points
commented 2025-02-28T11:40:53.48+00:00
Peter Reilly 0 Reputation points
1 answer One of the answers was accepted by the question author.

Check app configuration in a EF migration class

Hello, I have an web api hosted in Azure that connect to an SQL Database. Any changes to the database schema are done through EF Core Migrations. In a migration class (Microsoft.EntityFrameworkCore.Migrations.Migration) I would like to access the…

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.
11,317 questions
asked 2025-02-25T09:49:07.9966667+00:00
Angela_HAC 20 Reputation points
commented 2025-02-28T10:17:23.22+00:00
Angela_HAC 20 Reputation points
1 answer

Speech Recognition customize engine question on Windows

Hi MSFT member, On windows, when developing a Speech recognition app, there are about three solution APIs: Windows.Media.SpeechRecognition System.Speech Programming Guide for .NET Framework Microsoft Speech API (SAPI) Since We want to use local…

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.
11,317 questions
asked 2025-02-25T12:16:55.0766667+00:00
clark-zh 40 Reputation points
commented 2025-02-28T08:28:09.04+00:00
Jiale Xue - MSFT 49,051 Reputation points Microsoft Vendor
1 answer

Another instance of an entity raises an error when update

In my ASP.NET Core 9 Web API and Entity Framework Core, I have a model class for a Client that has a relationship many to many with the model class Channel. public class Client { [Key] public long ID { get; set; } } public class Channel { …

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.
11,317 questions
asked 2025-02-19T21:40:19.15+00:00
Enrico Rossini 201 Reputation points
commented 2025-02-28T08:11:38.48+00:00
Hongrui Yu-MSFT 4,605 Reputation points Microsoft Vendor
2 answers

Inserting a bitmap image into excel

Hi All,  I have created a BitmapImage object in C# from SQL server database table: var image = new BitmapImage(); using (var mem = new System.IO.MemoryStream((byte[])dataRow[columnName])) {     mem.Position = 0;     image.BeginInit();    …

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.
11,317 questions
asked 2025-02-27T09:08:44.3933333+00:00
Pratham Jain 241 Reputation points
edited an answer 2025-02-28T08:01:12.83+00:00
Hongrui Yu-MSFT 4,605 Reputation points Microsoft Vendor
1 answer

Azure PuSub with protobuf data not working

I am using generic WebSocket client (System.Net.WebSockets) to connect to Azure Web PubSub service and communicate between two parties. I referred this official document. I was able to communicate using json but with protobuf I don't receive any data.…

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.
11,317 questions
asked 2025-02-26T15:48:53.1566667+00:00
dheeraj awale 1 Reputation point
edited an answer 2025-02-28T08:00:38.3233333+00:00
Sampath 510 Reputation points Microsoft Vendor
0 answers

Capture Touchpad events only

We are trying to monitor the Touchpad event like touchpad left click, touchpad right click, or touchpad double tap, etc. I have a few questions w.r.t. TouchPads. How to monitor Touchpads events? How to differentiate between Touchpad events and Mouse…

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.
11,317 questions
asked 2025-02-24T17:09:16+00:00
DieWithYourBootsON 21 Reputation points
commented 2025-02-28T06:08:26.8133333+00:00
Jiale Xue - MSFT 49,051 Reputation points Microsoft Vendor
0 answers

VCore seconds used in SQL Query

Is there a process I can run to determine how much compute time (VCore seconds) was used by a previous query (select/insert/update/delete). I am thinking of something similar to "SELECT SCOPE_IDENTITY()" that returns a system generated ID…

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.
11,317 questions
asked 2025-02-27T18:53:56.5333333+00:00
Admin eSMMS.tech 20 Reputation points
commented 2025-02-28T02:29:02.5666667+00:00
Jiale Xue - MSFT 49,051 Reputation points Microsoft Vendor
1 answer

How do I configure the dotnet Console logger to not emit the log level?

I am using the stock standard console logger, however it is unuseful for me to have info: at the start of each line - how can I remove this via config? 2025-02-28T00:02:10.553Z info: Scope.Scope.Scope[0] blah blah blah Here is my current…

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.
11,317 questions
asked 2025-02-28T00:50:57.86+00:00
catmanjan 61 Reputation points
answered 2025-02-28T02:12:21.83+00:00
Jiale Xue - MSFT 49,051 Reputation points Microsoft Vendor
0 answers

How do you use the SqliteVectorStore in Semantic Kernel?

I have managed to get some basic RAG working with semantic kernel in C#, by creating a VectorStoreTextSearch object based on an InMemoryVectorStoreRecordCollection inside a InMemoryVectorStore and creating a KernelPlugin using…

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.
11,317 questions
asked 2025-02-26T00:25:58.3666667+00:00
Bao, Jeremy (Cognizant) 105 Reputation points
edited the question 2025-02-27T22:41:55.4666667+00:00
Bao, Jeremy (Cognizant) 105 Reputation points
3 answers

A connection was successfully established with the server, but then an error occurred during the pre-login handshake.

I am getting below exception for database connection with MAUI android emulator. Can you please help us to resolve issue. Microsoft.Data.SqlClient.SqlException: 'A connection was successfully established with the server, but then an error occurred during…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,490 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,962 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.
11,317 questions
asked 2023-08-10T06:08:11.2633333+00:00
suresh tanukula 15 Reputation points
commented 2025-02-27T19:40:00.24+00:00
Georyitt Gorayeb 0 Reputation points
1 answer

Different record returned from SQL Server Management Studio and a C# ExecuteReader with the same exact query?

I am using the EXACT same query in SQL Server Management Studio (2014) as I am in my C# program, but I get different results. How is this possible? My Query: SELECT tblWTHistory.Date, tblWTHistory.EstCompDate, tblOperator.BadgeID,…

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.
11,317 questions
asked 2025-02-26T17:32:50.5466667+00:00
Alvord, Timothy 276 Reputation points
commented 2025-02-27T09:36:28.03+00:00
Hongrui Yu-MSFT 4,605 Reputation points Microsoft Vendor
0 answers

How do I extract images from a document

I'm using: "Operation< AnalyzeResult > operation = client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-read", fileUri).GetAwaiter().GetResult();" to obtain a documents text and OCR text. Is it possible to also obtain the…

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.
11,317 questions
asked 2025-02-26T15:20:15.96+00:00
David Downing 706 Reputation points
commented 2025-02-27T06:09:08.3766667+00:00
Jiale Xue - MSFT 49,051 Reputation points Microsoft Vendor
1 answer

Only one compilation unit can have top-level statements. Visual Studio code error

Hi, I am trying to compile some code and keep getting this error. I deleted the code and rewrote it but still getting error CS8802 after inititiating dotnet run in terminal. See my code below: using System; int currentAssignments = 5; int[]…

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.
11,317 questions
asked 2025-02-26T17:32:50.2333333+00:00
Ayhan Celebi 0 Reputation points
answered 2025-02-26T18:10:06.83+00:00
Bruce (SqlWork.com) 71,696 Reputation points
3 answers

AppShell- Failed to Navigate Back, Ambiguous routes matched for.... but i've only registered routes once

I am building an Xamarin Forms app for iOS and Android. I registered my routes in AppShell.xaml.cs globally like this: **-AppShell.xaml.cs-** Routes.Add(nameof(HousingFolderPage), typeof(HousingFolderPage)); Routes.Add(nameof(HousingFolderDetailsPage),…

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,378 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,598 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.
11,317 questions
asked 2023-03-26T23:28:07.2466667+00:00
Nabil 6 Reputation points
answered 2025-02-26T17:38:59.5166667+00:00
Paul Reedy 0 Reputation points
1 answer One of the answers was accepted by the question author.

Upgrade .Net framework 2.0 to latest version

My current project is .Net Web Form with .Net framework 2.0 version (Visual Studio 2005). I want to change .Net framework latest version (with Visual Studio 2019). Is this possible 2.0 to 4.8 directly. Or, should I change to another version (like…

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,598 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.
11,317 questions
asked 2022-05-24T02:33:37.117+00:00
Yee Mon Zaw 31 Reputation points
commented 2025-02-26T13:35:59.1366667+00:00
Mehandi Hasan 0 Reputation points
4 answers

Has C# a cursor data type

Dear All, I am converting a Visual FoxPro (VFP) program to a C# program. In VFP there is a data type "Cursor" (with columns and rows) to store data retrieved from SQL Server. Has C# a similar data type? For example, the following screen capture…

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.
11,317 questions
asked 2023-07-23T08:20:29.26+00:00
BenTam 1,761 Reputation points
commented 2025-02-26T09:20:23.21+00:00
Alessandro Bitetto 0 Reputation points
1 answer

How to combine multiple xml files with different schema to one csv file

I have 33 xml files with different schema to convert to one csv file.

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.
11,317 questions
asked 2025-02-25T13:40:03.2433333+00:00
CJoeS 0 Reputation points
answered 2025-02-26T02:57:05.7066667+00:00
Jiale Xue - MSFT 49,051 Reputation points Microsoft Vendor
1 answer

My Create a bot template is not completeing

I'm trying to deploy a bot using the 'Create a bot' from Language Studio. I've followed all the instructions and it is just hanging. I've just upgraded to developer support is this it?

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.
11,317 questions
Azure AI Language
Azure AI Language
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
465 questions
asked 2025-02-17T00:23:58.12+00:00
Mike Allen 11 Reputation points
commented 2025-02-25T15:41:57.51+00:00
Sina Salam 18,861 Reputation points
1 answer One of the answers was accepted by the question author.

NET Core 3.1 app clickonce publish include a folder(from library project)

WPF Prism desktop project sln module folder data.txt module.cs app app.cs app references module module is a .dll project app is .exe project <Content Include="folder\data.txt"> …

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,833 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.
11,317 questions
asked 2021-09-26T14:37:02.377+00:00
Grant Yu 21 Reputation points
accepted 2025-02-25T03:27:26.3066667+00:00
Grant Yu 21 Reputation points