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
0answers
5 views

Getting all events of a Control in C#

I am trying to get all events information concerning a specific control. For this purpose, I wrote a snippet of code that works if I hard code the class name, But when I try to make it dynamic it ...
1
vote
0answers
11 views

C# Drawing Lines with TextBox

I have an application where I can add a textBox on the screen and move it. When I add more than two textBox, I double-click on top of two textbox and a line connects both. My question is: How to make ...
0
votes
0answers
4 views

Visual Studio OleDB Exception unhandled || I am writing a code to validate my form from access database in Visual Studio.

Code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using ...
0
votes
0answers
6 views

Using EventWaitHanldes between Windows Service and Windows Application

I have a requirement to send signal from a Windows Service to a Windows console/Forms application using Named Events. I created a common NamedEvents class library which has the implementation to ...
0
votes
0answers
8 views

Transfer items between drop-down lists in different webForms

I am a not experienced programmer, just a rookie enthusiast. I have a webForm where I add items to a drop-down list. There is another webform that contains another drop-down list, I want this ...
0
votes
0answers
11 views

Form login information

I am trying to get the Form to place the login information to login to the student account using their ID and password from the DATABASE code How do I add the studentiD and Password to the form and ...
0
votes
0answers
6 views

Populate a table from dropdown in asp.net mvc 5

I am using asp.net mvc 5. I have created a the following basic application. I want to add items to a list from a drop down and show them in a html table. For a example i want to add multiple subjects ...
0
votes
0answers
7 views

Calculating integrals in Mathcad with C#

I need to use Mathcad to calculate integrals. This is my C# code: public double Integral(double z) { Mathcad.Application mc = new Mathcad.Application(); Mathcad.Worksheets mwk = ...
0
votes
0answers
6 views

WPF Textbox Validation on Startup

In my WPF project I have added validation to a string property named 'Address' as follows: <TextBox Grid.Row="5" Grid.Column="1" Margin="5" Validation.ErrorTemplate="{StaticResource ...
0
votes
0answers
3 views

Consuming REST APIs using list of objects rather than header:string

I am trying to consume an API in C#, the data in question looks like this: "MXN": "Mexican Peso", "MYR": "Malaysian Ringgit", "NOK": "Norwegian Krone", "NZD": "New Zealand Dollar", "PLN": "Zloty", ...
0
votes
0answers
5 views

Getting Items From Within ItemsControl (Understanding DataContext)

I am populating an ItemsControl with various elements, including Buttons and ComboBox elements. Accessing and populating the elements is simple, but I'm stuck on how to detect and associate which Item ...
0
votes
1answer
10 views

Select constant and union with another list

I have a Category table with pk and sName columns. I want to add additional row with constant values such as pk = -1, sName = "NONE" so that the user can select "NONE" row if they want to. Below is ...
0
votes
1answer
18 views

Difference between 0 and 0u

Text from a textbook: The uint type is 32-bit unsigned integer type. Its default value is the number 0u or 0U (the two are equivalent). The 'u' letter indicates that the number is of type uint ...
-1
votes
2answers
24 views

c# - common objects among a list of objects

I have the following list of list of Person objects List<List<Person>> setofPersons=new List<Lits<Person>>(); I add items to it like this. List<Person> ...
0
votes
0answers
17 views

ASP.net Sequence contains no elements

I am trying to make a website where a user can upload a jar file that they make, They can set a price, title, description etc. I had it all working, But i forgot to include an image for the plugin. ...
0
votes
0answers
20 views

Bootable program? [on hold]

im wondering if its possible to create a program that can run when the computer boots. some comparable examples can be kon-boot program and many partition software that restarts the pc to run in ...
0
votes
1answer
17 views

WPF Rotating image with arbitrary angle

I am trying to make BitmapImage myImage1 and myImage2 rotate to an arbitrary angle (could be 45, 30, 10... etc.) The error I'm getting is that I can only rotate it to 90, 180, or 270 degrees. XAML ...
0
votes
1answer
11 views

Sending Queries to SQL Server once added to server explorer in Visual Studio 2013

I am using visual Studio 2013 Professional and Microsoft SQL Server 2012. I have my server found in Visual Studios and created a Data Connection to it so it shows up in my Server Explorer (see image ...
-1
votes
0answers
27 views

Changing nested for loops into recursion (C#)

I know this code smells badly, but i don't have any idea how to write it the elegant way. I want to write this method in better style, add a parameter telling it how many nested for execute before ...
0
votes
0answers
4 views

Background audio player

I'm using C# and Windows Phone 8.1 as Universal App. I want create a background audio player ( I don't want to use microsoft sample for this because it is to hard) I used this code for Windows ...
0
votes
2answers
14 views

Domain Model Object to View Model Object in MVC

I want to use view model for displaying instead of domain model. I have got these view models classes: public class ArticleDescriptionViewModel { public string Title { get; set; } public ...
0
votes
1answer
6 views

How to reference an element in the UserControl's style from the UserControl's ContextMenu?

Given a user control incorporating the MVVM pattern containing a context menu and control template, how can an element within the style be referenced from the context menu? The following code appears ...
1
vote
1answer
4 views

Add dynamically generated file in MSBuild task to output and appx folders

I have created a build task that dynamically generates a file for the project it's used in. I've managed to get that file to be copied into the $(TargetDir), but not into the AppX folder. The reason I ...
1
vote
0answers
4 views

Entity Framework using edmx on MySQL MAC/Linux using Mono

I setup an Entity Framework 6 Project using the Database First (EDMX) on windows using Visual studio 2013 and made it work to point at MySQL on my MAC machine. I then opened up the same project in ...
0
votes
1answer
28 views

Get Bool from C# Class, Send to form

So i have this class called BinaryKeyInterchanger.cs in that class i have the following code. public class BinaryKeyInterchanger { internal void MapEscape(object sender, KeyEventArgs e) ...
1
vote
1answer
8 views

Updating Variables In Unity 5

Using the Unity UI, every time you click a button, your score goes up by 60. I have another script which is taking that variable and adding it to another score. But when the program starts, the score ...
-1
votes
1answer
10 views

Display name does not exist in the current context

The name '' does not exist in the current context crn courseid timedays Roomnumber At the display, none of the items are recognized. Why is the display not seeing them when they were declared as set ...
0
votes
2answers
19 views

What is exactly a “Children” In a MDI app of C#? Problems with HasChildren

I'm making an MDI App that Works like a text editor. I'm using a method that verifies that there is an MDI Children form existing to perform an "undo" action with HasChildren. private void ...
0
votes
0answers
10 views

Cascading drop down and filtering dynamic data entity framework, code first in web forms

I feel like I am muddling through to what I want to do here and need some guidances. I have a table with multiple foreign keys. I am using VS 2013, Entity Framework code first and web form ...
0
votes
0answers
8 views

Lift object in place and follow mouse on other axis's

So I am trying to get a rigidbody to lift in place to a set height and then move on the other axis's with the mouse. private void levitateObject() { Ray playerAim = ...
0
votes
1answer
29 views

How to call a method from another class in a button click event?

I'm trying to call a non-static method (LoadingListBox) in my class (ListDisplay) from a button click event in my AddTask class. namespace Project { public partial class ListDisplay : Form { ...
-1
votes
0answers
6 views

Why does one trigger break another in my WPF/XAML Template?

I've a glass button template that makes a button glow when it is moused over; however, I also want the button to glow when it has focus as well, so I've implemented another trigger, and in order to ...
0
votes
0answers
17 views

AutoMapper failing to fetch from Navgation Properties

I have this code GetCitiesInfo() code works fine and returns data from navigation property, but so is not the case with GetCityInfo(). Anything I am missing? //Works for list public ...
0
votes
0answers
8 views

WCF service and client configuration for anonymous client with required encrypted and signed message

I want to know what is the best binding and service and client configuration supports the following scenario: I need to use WCF to create and expose a service which is public and there is a .NET ...
0
votes
0answers
13 views

Asp.Net Mvc hierarchical categories self-related with One-To-Many

I'm trying to create category tree. With this purpose i created some classes. I done somethings let me show you what i did and whats gone wrong. I created a self-referenced model like below. public ...
0
votes
1answer
9 views

Source property of image control in wpf

Please I have this problem, I’m working on a wpf project that recognize faces, so I want to display a cam images stream in "Image" control in the C# code . The problem is : the image control take a ...
0
votes
1answer
36 views

C# Path.GetTempFileName() with specific path

I'm creating a temp file and get its path with this code: public ActionResult Comp(string Link) { var sv = Server.MapPath(Link); int quality = 45; string ...
-1
votes
0answers
17 views

RotateTransform is bound to 90 degrees

I am trying to make an image rotate according to an offset read by an SDK. Here's my code: private void turnTo() { TransformedBitmap tb = new TransformedBitmap(); var biRotated = new ...
0
votes
1answer
5 views

Key Gesture for any combination of integer after CTRL

I am using key gestures in C# as hot keys for my application I know how to do ctrl+shift+s new KeyGesture(Key.S, ModifierKeys.Shift | ModifierKeys.Control) but can any body tell me how to get ...
1
vote
1answer
13 views

Windows Forms Settings Values Don't Persist Between Sessions

I am developing a Windows Forms application which ideally will store inventory values between sessions. In the past, I have been able to save the Properties.Settings values between sessions. However, ...
1
vote
1answer
19 views

Dynamically build query for Azure DocumentDB

I recently swichted from MongoDB to Azure DocumentDB and want check if a duplicate document exists in the collection by dynamically building a query. This is how I solved the query building with ...
0
votes
1answer
29 views

Parameter not given value

So I have an SqlDataSource which uses the following query depending on what the user inputs: string query = "SELECT * FROM Cars WHERE "; if (make != 1) { query = query + "make_id = ...
0
votes
5answers
28 views

LINQ collections discrepancy?

I have a question about two bits of code that seem to function the same way at a glance but produce different results when I build and run them. Code A: String[] colors = {"green", "red", ...
0
votes
0answers
20 views

Binding objects with async methods to a ListView

Hello stackoverflow community, Let me preface this question by saying that I am a newbie to XAML / WinRT app development. IN C# I have a button that when clicked, calls Method A() which returns ...
-1
votes
0answers
8 views

Is that possible to fire an event when Application.Current.Dispatcher.Invoke completed

I am using below way to update UI in the main UI thread if (Monitor.TryEnter(updateLock)) { try { var vrList = ...
0
votes
1answer
18 views

Unable to insert to remote database C#

I've been attempting to write to a remote database, however I keep receiving errors when I attempt INSERT INTO. I can read from the database just fine and have used to to make sure my connection is ...
1
vote
1answer
46 views

Group on Two Columns and Create Two Separate Counts

Question We have a table of StudentId and LectureId, and we want to know two things. CountStudentId How many times each StudentId occurs. CountStudentIdLectureId How many times each StudentId + ...
0
votes
3answers
16 views

removing items from list that exist in another list based on an ID member

I have a model: public class Post { public int PostId { get; set; } public string Description { get; set; } } I have two lists: List<Post> posts List<Post> exceptions I want ...
-3
votes
0answers
18 views

In C#, Error Message, are you missing using directive or an assembly reference?

Here is my code , can you help what is missing? I have tried to change it but does not seem to work.... using System; using System.Collections.Generic; using System.Linq; using System.Text; using ...
0
votes
0answers
16 views

MySQL Database connection with c#

When i built database and Entity Relation Diagram (ERD) between tables (Primary key , Foreign key and so on ). How to do it to create relation in c#? For example : there are three tables ...