Questions for c#


896

How do I populate a dropdownlist based on a selection from another dropdownlist?

protected void ddlEnvironment_SelectedIndexChanged(object sender, EventArgs e)
305

GTK How to rearrange items in a tree/list via drag and drop

I am trying to rearrange items in a single GTK TreeView with a ListStore model. How can I do this?
4716

Executable fails with weird exception

I am using ILMerge and Quartz.NET in a C# .NET 4.0 Windows Service application. The app runs fine without using ILMerge, but now that we're nearing shipping release, I wanted to combine all DLLs in...
2387

How to develop addin for MS Outlook?

How do I develop addin for MS Outlook that works with all
3147

a thought on mvvm structure building

I developed an app on windows phone using c# and xaml.
5925

Using FsrmQuotaManager with a WCF service

I'm using a WCF service that is running on an IIS 7.5 (W2k8 R2). I use this service for getting quota information about the space of a specified web site on the same IIS.
6979

Is there a library for notification/alert in .NET?

I need to design a notifications framework written solely in .Net. I was wondering is there were some libraries already available to ease in creating rules for the notifications.
1962

Consideration of points while started to build some open source applications

There are lot of open-source application available in these days which provide various things like blogging, cms, own branded application etc.
5523

Sending potentially sensitive data via XML in C#

What is the best practice for sending potentially sensitive data to a web service via XML in C#?
8933

Regular Expression option for 3 or less characters

I have a regular expression below that works for a string example like:
1609

What does the FileDialog.RestoreDirectory Property actually do?

I've read about the property on MSDN, but I still don't understand what it does.
2062

Overlapping matches in Regex

I can't seem to find an answer to this problem, and I'm wondering if one exists. Simplified example:
3978

How to specify AddIn process names?

I am using the Microsoft AddIn Framework to load AddIn assemblies. I am running them in their own process as to separate them from the service. The thing I don't like it that every AddIn process ...
4467

In C#, can I know in the base class what children inherited from me?

I have a base class vehicle and some children classes like car, motorbike etc.. inheriting from vehicle.
6729

.js files not being located by website on Win 2008 Web Edit IIS 7

I have been going around in circles with this for a couple of days now. I usually find what I need without posting.
1478

Image sizes in a FileInfo variable

I'm currently working on a control which displays all images held within a folder so that the client is aware of what they have uploaded.
2524

ASP.NET MVC: How do I pass a list (from a class in Model) to a repeater in a View?

How do I do the above? I've started using MVC and I'm having issues passing data around.
8043
8385

Show progress bar when Entity Framework transfer data

I have a project that uses data from Entity Framework and present them in WPF. I want show threaded progress bar when Entity Framework load/save data on presentation layer.
3241

c#: Will this code get optimized out?

I was reviewing some code given to us by a third-party outsourcing firm and ran across this little gem:
776

How to save/discard values of controls of a form, upon pressing Ok/Cancel button?

Please guide me as how to save/discard values of controls of a form, upon pressing Ok/Cancel button accordingly in Visual Studio C#?
288

Methods and Timer in C#

When I debug this small program step by step with F10 button, the program is rational until it reaches the level timer.Elapsed +=. after this it is supposed to go call my method Check(MyConn) but it
4475

How can I get the rows from SHOW PROCESSLIST using MySQL Connector for .NET or Dapper?

I need to parse the running queries on my MySQL server. What is the easiest way to retrieve the result of SHOW PROCESSLIST from within MySQL Connector for .NET, or using Dapper?
6778

C# StackOverFlowException when creating new instance of class

Hm i get a strange problem. when i creating new instance of class i get StackOverflowExcepion :)
8494

Database design and hosting solution

I'm trying to prepare to build a database driven .net application and I have hit a roadblock early on due to my lack of knowledge on this topic. Searching around didn't yield anything so here I am ...
177

How do draw FormattedText (if not in the onRender method)

I draw some Ellipse and add them to a Grid.
7550

Sorting of Gridview data

I have A Grid view and I want to sort the Gridview .I tried severel methods from google and they are not working in my side.
8577

XML document - Object reference not set to an instance of an object

I'm working on a website where I need a google map to display the positions of the members of the site.
6422

C# Design Pattern for 2 classes with same implementation but different base class

Take two base classes A and B which are similar but are preferred to be distinct. Each has a sub class (A' and B') which add the same functionality and members to their respective classes. Is the...
4631

How to open a network connection from windows mobile with c#?

I am trying to convert a windows forms application to a windows mobile application (windows mobile 6 professional). It needs to get an XML document from a web server. It works fine if the device
9741

Can someone explain why this operation is invalid?

I was reading up on covariance and contravariance today and I came across a post on stack exchange where Jon Skeet was explaining invariance at the class level. He used an example of fruit and why
8429

A strange thing about Nullable Boolean type, And and Or in C#

I have a strange problem about the following codes:
1948

Pass variables and access methods of User Control from CodeBehind

So I have a function renderWidget() in default.aspx.cs. The idea of this is to add a User Control to a page.
807

Read CSV data in batches and Process it

I have a csv file that looks like this
5220

best way to display multi-columned data in grid format in winforms?

What is the best way to display multi-columned data in a grid format using C# WinForms?
7899

“Object is currently in use elsewhere” exception when setting image in picturebox

With the title, there are several questions but none of them could help me or direct me to solve my problem.
5800

Better way to constantly run function periodically in C#

I have a C# program that is constantly checking for new additions to an online DB. I have this code to have it check every 10 seconds
5044

Report generator options for a Winforms app?

I’m selecting a report generator for my .NET winforms app and it’s driving me crazy. I’m not familiar at all with report generators so…
2972

Resources to create your own html 5 / css3 layout engine in C#

Are there any resources out there for how to create your own layout engine (like webkit) in C#, that supports html 5 and css 3, preferably through MSHTML, or anything else.
2364

C# converting a decimal to an int safely

I am trying to convert a decimal to an integer safely.
3012

Monitoring C# Threads - Which does what/when

As everybody, I am used to debugging my code in VS in step-by-step mode. Well, now that I have an application with many Background Workers everywhere, I am not in Kansas anymore.
8593

using a class defined in a c++ dll in c# code

I have a dll that was written in c++, I need to use this dll in my c# code. After searching I found that using P/Invoke would give me access to the function I need, but these functions are defined ...
5717

Using old DLLs in C# .Net 4.0

this is actually a follow up to a question I asked yesterday about problems with using older DLLs in Visual C# 2010. I have added the configuration file and the DLL runs well. The issue I'm having is
4202

Sum X Values from Database

In my database SQLServer, I´ve got a associative table ID with KID and amount. I want to sum up the values from every ID. That means that I want to have the amount from KID 6, the KID 10 etc..
9682

Implementing IComparable for Dynamic Comparision

I have to get a Circle from a List<Circle> depending on the current MousePosition
2081

Image.Save(..) throws a GDI+ exception because the memory stream is closed

i've got some binary data which i want to save as an image. When i try to save the image, it throws an exception if the memory stream used to create the image, was closed before the save. The reaso...
202

How to programmatically turn on “Network Discovery” in Windows OS?

My project open ports using UPnP protocol. Windows disables UPnP device discovery by default, one needs to turn on Network Discovery in Network and Sharing Center to enable UPnP device discovery.