C# is a multiparadigm, managed, garbage-collected object-oriented programming language created by Microsoft in parallel with the .NET platform

learn more… | top users | synonyms

0
votes
2answers
36 views

Setting fields with correct default value

When writing constructors, I regularly encounter a situation where some fields already have approperiate (default) values, such as false for boolean values and 0 for integers. What are reasons to ...
-1
votes
0answers
63 views

Proprietary languages [on hold]

A company that I work for have a valued reason for adopting a proprietary language, which is highly efficient in the work that they do, moreso over other mainstream languages. I was told that syntax ...
0
votes
0answers
38 views

How to write an Excel workbook to a MemoryStream in .NET without first saving it to the file system? [migrated]

All options within the Microsoft.Office.Interop.Excel.WorkBook save options take a filename. And not sure how to use Microsoft.Office.Tools.Excel.WorkBook. I have also found another query here which ...
0
votes
2answers
80 views

In Asp.net, how browser knows a textbox is registered with server side TextChanged event?

When I evaluate asp.net control events, I am not able to identify how the browser is aware of asp.net textbox is subscribed to serverside textchanged event or not. When I look the server generated ...
-3
votes
0answers
50 views

i got stuck in combination buttons .i have a problem and i'm new in this world. Please Help me. [on hold]

I must to do an computer with 2 textBox and 5 buttons ( +, - ,* , / and a button calculate). when one button of the 4(+ - * /) will be operated will remain active and will be the calculation of the 2 ...
1
vote
1answer
69 views

Linking to MIT-Licensed dll

I'm currently working on some closed-source proprietary software that makes use of a library (SharpAVI) distributed with the MIT License. The SharpAVI source isn't being used directly anywhere in my ...
0
votes
0answers
98 views

Why Doesn't SMTP Mail Attachment Dispose When Client Does? [migrated]

This is an issue that I recently solved, but was wondering if somebody could help clear this up for me since I don't fully understand what exactly happened. I created a simple smtp email client and ...
1
vote
3answers
210 views

Trying to come up with a mapping convention for C# objects

so this is C# but it could apply to any OO language where different sets of objects exist across different layers of an application. We have been trying to come up with a convention within the team ...
-7
votes
0answers
26 views

i'm having a problem related to dll version conflict in inheriting the form [on hold]

I'm having the problem related to inheritance of the form and while adding or referring the dll, it give me error of conflict of dll of same name. can anyone guide me
0
votes
2answers
212 views

how to approach pharmacy software project [on hold]

I would like to complete a pharmacy software proof concept. But I have a few questions I do not know. Physician information In order to refill or dispense a new RX the software needs to have access ...
-1
votes
1answer
52 views

converting WKT to GeoJSON [on hold]

I am working on a library to convert Well Known Text into geoJson. For converting WKT representation of a multiPolygon would it be best to find polygons with a regular expression or by parsing the ...
3
votes
2answers
113 views

How are composite tables generally handled when there is no ORM tool available?

I am developing a Windows Runtime Component (C#) to be used in an HTML/JS frontend for a Windows Store App. Now, one of the requests is to have a database on the local system to store metadata about ...
4
votes
5answers
1k views

Is this a good practice or not?

I have a colleague who has come up with a way of 'genericizing' information from a database so that all his web application's drop-down lists can share the same object in his MVC.NET C# code and ...
-3
votes
0answers
32 views

What is the best framework to develop an Android app that connects to an existing MySQL database through a web service? [on hold]

I have experience developing Android apps using both Eclipse (Java) and Xamarin (C#). I have never tried connecting my apps to a database until now. It sounds like I need to use Android tools to call ...
0
votes
2answers
98 views

How to deal with a new version of visual studio's directory?

When upgrading Visual Studio to a newer version, a new directory is created e.g. "Visual Studio 2013". I understand that that makes sense as we want to differentiate between code targeting different ...
0
votes
2answers
80 views

Best way to port Pascal persistence method to C# [on hold]

My new jobs is to port a Delphi application to C#. The Delphi application was originally developed as a proof of concept and after it entered production the company wanted it ported. I'm required to ...
4
votes
1answer
117 views

Is it good practice declare a function inline?

I'm writing a method and depending on a config field I need to change where I get my data from. What this results in me having to write code that looks like this: List<string> result = new ...
0
votes
0answers
31 views

Can sequence alignment algorithms be used for search implementation?

Hi I want to implement a search on a website which includes imperfect search results. Meaning, if the search term is misspelled or slightly different from a 100% match, the function should still ...
1
vote
0answers
38 views

Managing debug information of C program for Eclipse

I am not sure if the title is appropriate. I have written a parser for CDB files in C# and ANTLR that creates runtime objects for me such that I can pass it to the TCF Agent which takes care of ...
0
votes
1answer
98 views

Coding shortcuts for type conversions or similar [on hold]

bool? example = null; is actually Nullable<System.Boolean> example = null; Now for the bool to System.Boolean conversion or actually compile-time replacement: We ususally hardly care, as it ...
0
votes
1answer
77 views

Confused on how to properly employ a Repository Pattern with Service/Business Layer on top

I'm building a ASP.NET Web Api 2 solution for learning purposes, and I've hit a snag. I was wondering if anyone could tell me what exactly it is that I'm missing. My Web Api solution has 4 Layers: ...
0
votes
1answer
54 views

Full signed part of two complement long [closed]

I am reverse engineering a data file (from a synthesizer). It seems that e.g. -1 is written as FF FF FF FF, so in four bytes. while +1 is written as 00 00 01 (--), so only three bytes. Is something ...
3
votes
0answers
130 views

How to best implement K-nearest neighbours in C# for large number of dimensions?

I'm implementing the K-nearest neighbours classification algorithm in C# for a training and testing set of about 20,000 samples and 25 dimensions. There are only two classes, represented by '0' and ...
0
votes
0answers
11 views

Dynamic Data won't display calculated fields; ASP.NET 4.5, Entity Framework 5.0 [migrated]

I'm trying to display calculated fields in my Dynamic Data Entities site. I have generated my EDMX file from an existing database, and have added customizations in a separate file using partial ...
0
votes
0answers
41 views

Better approach to online builder [migrated]

I have a windows forms application which needs customized dll files to be built and for that I am using an online builder using asp.net. I am in no way a asp.net expert not even near a beginner but ...
-1
votes
1answer
58 views

System and Application Monitoring Idea [closed]

I am attempting to write a monitoring service of some variety using C# that will provide information about the server the service is running on. This information will be system process information, ...
1
vote
3answers
112 views

Commenting strategies in C# & asp.net web api

I've been working on a ASP.NET Web Api 2 project as a learning exercise, and I was wondering what the norm regarding commenting is. I use the Repository / Service Pattern, and everything is very much ...
-2
votes
0answers
52 views

which is the simplest/fastest way to do a c# dotnet soap client based on a wsdl file? [closed]

Existing Serverside with no direct access to code (hosted on a Server of a partner company) i do have access to the wsdl file. direct on the server or if needed i also have a local copy Is there a ...
0
votes
0answers
4 views

How to inject a .net Provider (OAuthAuthorizationServerProvider)? [migrated]

I'm looking for a solution how to inject IApplicationUserManager into a OAuthAuthorizationServerProvider.cs This is the sample I'm looking at now: ...
0
votes
0answers
64 views

Scope of serialization [migrated]

3 classes organizationalUnit workFile workItem They're in some sort of Pyramid pattern: 1. Contains one or more of 2. 2. Contains multiple of 3. Each contains a reference to their "container": All ...
1
vote
3answers
260 views

Why shouldn't an object reference have access to a static member in C#

Context of my question: I am reading C#. Trying to understand Static keyword. I understand that when Static is applied to a member of a class, it can only be modified by the class and not the class ...
-3
votes
0answers
17 views

How Can I Show Up A Search Result In A Textbox? [migrated]

I’ve created a table Code and would like to search and retrieve an answer introducing device Imei in textbox imei und when I click on the search want display the result(code_mck)in textbox code i want ...
2
votes
1answer
114 views

Is serialization better done in instance methods or static methods

Say I have a class workStockItem, that I wish to serialize. Which is the better style? using a static method or using a non-static method (maybe even implemented as a property as seen below) ...
1
vote
1answer
72 views

Implement Generic DataSet Builder with C#

I want to create a data access library that can build a DataSets with relations which can easily be written to XML with dataset.WriteXML(). This is a get to know C# endeavor that will hopefully gain ...
4
votes
3answers
148 views

Is it a good idea to return a default value if a field in a query cannot be found?

At the place I work we are using a SafeReader class that wraps an IDataReader. One of the 'features' is that if the field you are trying to access wasn't in the query then it just returns a default ...
3
votes
2answers
627 views

Why does C# have much more features than Java? [closed]

Please note that this isn't meant to be a Java vs. C# argument. I'm a Java programmer with no C# experience, asking just out of curiosity. I did some reading on C#, and it seems it has much more ...
1
vote
0answers
109 views

How to backup data and images in this project?

I have MS C# and MS SQL 2008 database project. It can capture employees' records with pictures of more than 1000 records. Presently, I'm able to capture say 150 records on PC1 using my installed C# ...
6
votes
2answers
150 views

Why does F# Core define generic array types?

I just noticed that the FSharp.Core namespace includes generic array types of up to 4 dimensions, i.e. Core.[]<'T>, Core.[,]<'T>, etc. C# and VB seem to be doing just fine with System.Array - ...
1
vote
2answers
146 views

When to use [Pure] on a constructor?

I'm learning about code contracts in .NET, and I'm trying to understand the idea of pure constructors. The code contracts documentation states: All methods that are called within a contract must ...
0
votes
2answers
83 views

Alternative to Static Abstract Property/Method

Since trying to use them will cause an error what is the workaround to get the same effect as them? My Base Class: public abstract class IPacket { public abstract int Identifier { get; set; } ...
1
vote
3answers
101 views

Passing two different types down a chain of calls because of an overload further down

I've got myself into a bit of a mess. I've got code coming from Main, through myMethod and down to OtherMethod. One of the parameters can be either an int or a string, which affects OtherMethod but ...
0
votes
2answers
222 views

using this in a constructor, why does it work?

I got two classes. busiObj(created from ancient flat files) key(provides means to tell busiObjs apart) key has a c'tor that takes a busiObj public key(busiObj foo) { bar = foo.someThing; ...
2
votes
4answers
1k views

Going through The C Programming Language K&R in Visual Studio

From what I have read, K&R seems to be a good place to start learning programming in general, and C programming specifically. However, I've just started the first chapter and I have a few ...
1
vote
2answers
91 views

Scalable Job Handler

We have a job table that triggers a notification when a new job gets inserted. Clients that can handle such jobs may subscribe to those notifications. When a client receives a notification, he can ...
0
votes
2answers
51 views

Maintaining sequence number for the day while creating file from windows service

I have a windows service which invokes a dll periodically and creates files. The file names should be in sequence. Example files will be myfile1.txt, myfile2.txt....mfilen.txt. The number will ...
-2
votes
0answers
23 views

C# Stackexchange Questions API [migrated]

I need to build an web application and below is what i'm stuck with Can I use StackExchangeAPI's with Key? do they have a "hello world" key can be used for learning purpose. I wish to get the count ...
1
vote
0answers
65 views

Having trouble with exposing class properties across projects

I have several projects in my solution: Logan.Web.DBContext defines the DbContext for the database and builds the data model Logan.Web.Objects defines the classes that will represent the tables in ...
-1
votes
1answer
110 views

Approach to cover all the cases in Unit Tests [duplicate]

I am new to Unit Testing and i am able to write them but my problem is I am not sure that I have covered everything in Unit Tests. What could be the approach for testing some functionality in a code?
1
vote
1answer
129 views

Architecture of large-scale API (User Management)

We are currently designing an API that will hide different services (Product, Content, User etc) that will be used by our own website, our own apps etc. It is not a public API. We are looking into ...
0
votes
1answer
94 views

Entity Framework 6 Conventions

I use the Entity Framework often, but I have one area of confusion I would like to understand better. If I wanted to have a navigation property in an Entity such as public virtual ExampleObject ...