C# is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.

learn more… | top users | synonyms (5) | c# jobs

0
votes
1answer
6 views

Serialize only interface properties to JSON with Json.net

With a simple class/interface like this public interface IThing { string Name { get; set; } } public class Thing : IThing { public int Id { get; set; } public string Name { get; set; } ...
0
votes
2answers
14 views

Match and replace first and last character in string

I would like to remove % characters from the start and the end of a string. For example: string s = "%hello%world%"; Desired result: hello%world. I know that I can fix this with some if cases ...
0
votes
1answer
7 views

Read From Excel To GridView In ASP.NET

I want to read data from Excel file xlsx and bind the data to GridView. But when I try in this way I get the following exception The Microsoft Access database engine cannot open or write to the file ...
0
votes
0answers
4 views

Downloading( ftp programming ) with c#

public partial class C_backupTPForm : Form { long fileSize; private void S_Ftp(string selected_path) { FileInfo fileInf = new FileInfo(ftp_filePath); ...
1
vote
0answers
3 views

how to select datagrid in WPF

i'm creating WPF application, in that i'm struggling to retrieve data from data grid, How to select Value from custom data grid row in Windows Presentation Foundation application using c#.net.
0
votes
1answer
16 views

Structs and classes advice

As I'm learning c# I would appreciate some professional advice about structs and classes. As classes are reference types and stored on the heap, while structs are value types and stored on the stack. ...
0
votes
2answers
21 views

culture for datetime in c#

Hi all I have written a code to parse datetime as follows if (DateTime.TryParse(dsVchRecord.Tables[0].Rows[0]["Date"].ToString(), out _dtVoucherDate)) _dtVoucherDate = ...
0
votes
0answers
3 views

MainPageResized and ScenarioLoaded events from MainPage.xaml.cs

I'm studying some examples of C# from Microsoft, mainly MainPage.xaml.cs file. In that file some events called my attention: MainPage_SizeChanged and Scenarios_SelectionChanged. Both events are ...
0
votes
0answers
3 views

Exchange ews managed api create item in public folder

I have written the following VB code to create a contact using the Exchange managed API. It creates a contact in the default "contacts" folder within the inbox. However I need to know how to modify ...
0
votes
0answers
3 views

Azure Cache locks up?

I'm trying to get a basic cache implemented but it is locking up on the create step... I have tried several methods of "creating the cache" but they all freeze on the same step (where I new up the ...
-2
votes
0answers
13 views

C# - Purpose of WebClient.UploadString?

I've always wondered how to correctly use the "UploadString" method in C#.. I'm working a bit on PHP programming, but so far I'm quite the noob of it. I assume you'd use PHP as the URi. Or wait, maybe ...
0
votes
1answer
9 views

How to check if a cell is empty (Excel\VisualC#)

this might be an easy question for you and I saw a lot of topics about it, but none of them gave me the answer I need. My aim is to check line per line in the Sheet1 in order to discover how many rows ...
3
votes
4answers
42 views

Convert Enum to List

Say i have the following Enum Values enum Language { CSharp= 0, Java = 1, VB = 2 } I would like to convert them to list of values (i.e) { CSharp,Java,VB}. How to ...
0
votes
0answers
3 views

How to multithreading/batching when Indexing with elasticsearch

I am nearly new to use elasticsearch, and I need to index aprox 80M documents using the IndexManyAsync method, I am toward to batching documents, each will have 10000 docs and then add them to the ...
0
votes
0answers
8 views

EFTracingProvider The 'data source' keyword is not supported

I am trying to use Entity Framework Tracing Provider to trace EF query, I get The 'data source' keyword is not supported. error: I have a DbContext in a project call test.domain: public partial ...

1 2 3 4 5 31657
15 30 50 per page