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
1answer
352 views

How I could update a DB table using a POCO class bound in a DataGridView

I try to explain better using an example: I create the class Product with attibutes like that: private string _ProductCode = ""; [DisplayName("ProductCode")] public String ProductCode { get { ...
1
vote
1answer
163 views

Clarification about Event Producer in StreamInsight

I need a small clarification about streamInsight, I know by doc's that StreamInsight can handle multiple concurrent Events. But will the event producer be a separate function, for ex: I need to watch ...
0
votes
0answers
37 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
61 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 ...
1
vote
1answer
68 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 ...
-2
votes
0answers
47 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 ...
0
votes
2answers
210 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 ...
0
votes
1answer
98 views

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

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
2answers
174 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 ...
-1
votes
1answer
49 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 ...
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 ...
-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
4
votes
4answers
891 views

Exceptions vs ErrorCodes when working with devices

Out team is at the cusp of a new project. One of the components at the boundary of the system is the component which interacts with a printer through an external COM component (referenced as a usual ...
3
votes
2answers
110 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 ...
-3
votes
0answers
31 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
94 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 ...
9
votes
3answers
2k views

Am I wrong in thinking that needing something like AutoMapper is an indication of poor design?

Automapper is an "object-object mapper" for .Net, which means copying objects from a class into another class that represents the same thing. Why is this ever useful? Is the duplication of classes ...
0
votes
2answers
76 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
116 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 ...
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
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 ...
0
votes
1answer
97 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
75 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
53 views

Full signed part of two complement long [on hold]

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
100 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 ...
-1
votes
1answer
57 views

System and Application Monitoring Idea [on hold]

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, ...
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 ...
1
vote
1answer
224 views

Organising data access for dependency injection

In our company we have a relatively long history of database backed applications, but have only just begun experimenting with dependency injection. I am looking for advice about how to convert our ...
2
votes
1answer
67 views

Use adapter pattern for coupled classes

I need (for unit testing purposes) to create adapters for external library classes.ExchangeService and ContactsFolder are Microsoft's implementations in its' EWS library. So I created my adapters that ...
0
votes
1answer
179 views

Find possible variations of one item out of multiple baskets.

I have three baskets of balls and each of them has 10 balls which have the following numbers: Basket 1: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Basket 2: 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ...
0
votes
0answers
38 views

Better approach to online builder [on hold]

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
170 views

Has anyone tried Script#? [closed]

I was recently shown Script# and I'm considering using it. I'm curious if anyone is using it and If so how has it been using Script#? http://projects.nikhilk.net/ScriptSharp "Script# is meant to ...
20
votes
10answers
7k views

Constructor parameter validation in C# - Best practices

What is the best practice for constructor parameter validation? Suppose a simple bit of C#: public class MyClass { public MyClass(string text) { if (String.IsNullOrEmpty(text)) ...
1
vote
0answers
107 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# ...
1
vote
3answers
111 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 ...
1
vote
1answer
71 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 ...
-2
votes
0answers
51 views

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

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
258 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 ...
-4
votes
0answers
29 views

Entry from virtual keyboard should be treated as real keyboard [closed]

When we trying to inject some text to another application via sendkeys/sendinput/sendmessage/postmessage/keydb_event text from keyboard behaving as coming from virtual keyboard that is LLKHF_INJECTED ...
2
votes
1answer
113 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) ...
-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 ...
4
votes
3answers
147 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
623 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 ...
3
votes
1answer
47 views

Pattern to use to relate multiple data sources to different user data widgets

I have an client x server intranet application the basically gets data from the server, format it and send that data to the client for display. At the server we are using ASP.NET C# running on IIS ...
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
3answers
100 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
82 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; } ...
2
votes
1answer
88 views

how to process document state transition?

Imagine there is an application (ASP.NET MVC) that processes some documents. The document must be revised several times by different group of users. state/role rules: simple user can only publish ...