Questions for c#


588

How do I set Network Management settings or make the dialog appear in C# on Windows Mobile?

In Windows Mobile, when you open Internet Explorer and type in a URL that your device can't connect to, you are notified of this and prompted to (manually) navigate to the screen where you can actu...
1148

Binding an xml node's children to ASP.Net DropDownList

I'm trying to bind the contents of a node of XML to a Drop Down List without much success.
866

How can I get the size of an object in the HttpRuntime.Cache?

I am currently storing many different types of objects in the ASP.NET HttpRuntime.Cache and I was wondering if there is a way to figure out how big each object is?
756

Generate random enum in C# 2.0

Could someone please point me toward a cleaner method to generate a random enum member. This works but seems ugly.
530

Class Documentation Suggestions

We are a Microsoft shop, concentrated on using C#. We have several projects, including websites, Windows services, and class libraries, that incorporate XML comments.
1823

Generate distinctly different RGB colors in graphs

When generating graphs and showing different sets of data it usually a good idea to difference the sets by color. So one line is red and the next is green and so on. The problem is then that when the
6082

Content Defined in Class Library doesn't transfer during ClickOnce Deployment

I have a WinForms, C# solution that uses ClickOnce deployment that is causing some trouble with resource files. In short, files marked as Content in class library project do not get copied to the o...
2324

How do I run multiple events in a specific order?

I am new to c# and has a question about events on a WPF application. I have two events (Button_Click and myslider_ValueChanged) and would like the myslider_ValueChanged to run after Button_Click. I...
2052

How to read Http port in c#?

how can we read http port in c#
6770

Listing the contents of a database file which is to be displayed in a View

I'm using an open source fingerprint recognition program written in C# (SourceAFIS) which stores the enrolled users in a .dat file.
6953

good way to query many databases in ASP.NET

What I'm trying to do is run the same SQL select on many Oracle databases (at least a dozen), and display the output in a Gridview.
3699

Where to create singleton instance if I don't need this instance in my program?

Assume I have some singleton that just need to be instantiated. In constructor it starts timer, and updates some model data each second.
7727

WPF - ObservableCollection casting

I have a method named 'PersonsMeeting' that gets as parameter ObservableCollection of Person. Can I somehow deliver it an ObservableCollection of Employee ? what casting do I need ?
6739

Elegant way to implement INotifyPropertyChanged across many controls

I'm building a WPF application and I'm slowly uncovering some of the joys and also the frustrations of using WPF. My latest question involves updating the UI using INotifyPropertyChanged
6760

Can Silverlight 2.0 pages be removed from a collection manually (garbage collected)?

I have multiple xaml based pages stored as children of a canvas on another page. I add and remove the children pages as the application runs. However, pages that are removed from the children
4338

How do I email Active Directory distribution groups from a c# web application?

I'm trying to send email to Active Directory distribution groups.
9184

How to get ChildNodes of selected node in DevExpress XtraTreeList?

I am using DevExpress XtraTreeList. There are no checkboxes used. I want to get all childnode IDs of selected node. Note I already got ID of selected node, I just want to get IDs of child nodes of
8470

How does Collections and List store objects of different types ? Is it Possible?

How does generic collections and List store objects of different types ? Is it Possible?
4942

Thread Safe C# Singleton Pattern

I have some questions regarding the the singleton pattern as documented here:
1984

c# launch .exe from a remote folder

I made a .exe program in c# and locally works fine... but if I put the .exe into a remote path, when I launch, it gives error..
231

How do you organize C# code in to files?

In C#, the questions of what types to create, what members they should have, and what namespaces should hold them, are questions of OO design. They are not the questions I'm interested in here.
2678

Listbox extending off the page

I have a listbox inside of a stack panel inside of a border in a silverlight application and when ever I add anything to the listbox it increases in height so the scrollbar is never used and it ext...
9020

How to make a program to have its own version of PATH env

I want to know if I can have custom version of PATH env variable specific to my executable?
8276

ASP.NET MVC3 Html.EditorFor() problem

i try to bind data to model with Html.EditorFor() helper and submit, but model come to controller is null.
9576

How can I return NULL from a generic method in C#?

I have a generic method with this (dummy) code (yes I'm aware IList has predicates, but my code is not using IList but some other collection, anyway this is irrelevant for the question...)
7564

WP7 - OrderedDictionary / alternatives?

I'm completely new to C# so I'm about to make a horrible attempt at my own version of an OrderedDictionary unless someone can suggest an alternative.
281

How to make a TextBox accept only alphabetic characters?

How can I make a TextBox only accept alphabetic characters?
5463

Where is “Run Tests” in monodevelop

I have a solution already containing a library with NUnit tests. When I develop with Visual Studio, I normally run these tests with the nunit.exe binaries I have included in a tools\nunit folder in...
1297

how to render html tags on gridview asp.net from database

I have asp.net grid view to display techs notes. I am trying to force the grid view to display it as user enterd in text area
9834

encrypting password

i am about to make a 'log in' for my app and was wondering what is the best way to encrypt a password for my user that i will enter in my database ? I found many way on Google but don't know which ...
7521

How to make each Treeview Node have a related TextBox

I am trying to make a form in which the user fills in values. It is quite long. I wish to use an expandable tree to fit it into my one form. Is there any way to give each TreeView Node a TextBox by...
5462

How to write simple query to XElement?

Trying to use Linq to XML for the first time and having some problems. I have this XML file that needs to be read and used for various tasks. The file contains a list of entities called 'interfaces...
3909

Filtering Windows logs using lambda expressions on non-IEnumerable types

I'm trying to get and filter Windows logs based on some criteria, one of which is filter by Message. The Message property is in EventLog.GetEventLogs().Entries.Message. The problem is Entries is an
8551

Different behaviors with a for loop and a foreach loop with closures

I can't explain an issue I've run across. Basically I get a different answer if I use lambda syntax in a foreach loop than if I use it in a for loop. In the code below I register a delegate in a
2669

how do you pull in the html from a URL?

I have one site that is displaying html content that needs to be displayed on another site (first site is front end to content management system).
5001

Is it possible to create an ASP.NET web service fully contained in .svc file?

Is it possible to create a "drop-in" web service? What I would like to do is create an .svc file that can be placed into a web directory on IIS and accessed (and executed) via its URL, without havi...
7385

Need a good ASP.NET menu

I am looking for a good menu to use in an ASP.NET. I am currently using the asp menu. I need
6599

Elegant ways of avoiding numerous code changes in the following legacy code

In some legacy code, there are hundreds of occurrences of the following code snippets:
3898

Ajax file upload in mvc application

in my MVC app i using Ajax upload (Version 3.5 (23.06.2009)) in this part of code:
5698

DropDownList in Gridview Binding error Index 1 is either negative or above rows count

I have been trying to bind a drop-down list which is present in itemtemplate of my GridView.
9143

Using Late-Binding to Automate Word is throwing a MissingMemberException

i am trying to access some information from a running Microsoft Word application using the following code..
5146

Is there an inverse of System.Diagnostics.ConditionalAttribute?

Is there an analogous conditional-not-present attribute or maybe a way to use the Conditional attribute to only include a method if that symbol is not defined?
7773

Lazy loading large data sets in wpf tabs using MVVM

I should start by saying I'm relatively new to the MVVM pattern. Having said that, I've got two tabs I'm trying to load with large data sets. I would like for the first tab to load when the page is
9970

web service session works while debugging but not when its published

I'm finishing up my first web service. It stores data on a dataset that I later need to check up on, so I need to keep that information around.
5627

Converting TreeNode to DataTable Dynamically

There are plenty of methods to convert datatable into treeview (treenode) like this. But is there any way to do create a datatable maintaining hierarchy. For ex. if TreeNode is like
1091

How do I calculate angle from two coordinates?

I'm working on a project with 3D based objects and manipulating them via my program. I currently have a textbox that allows me to put a heading in degrees and a button that will calculate the requ...
3745

ASP.NET Connection to DB forcibly closed when importing data into table

I am using C# Visual Studio 2005 and SQL Server 2005.
7864

decode querystring within context.Request

i have an ashx file that requires some query-string values to deliver appropriate images.
2735

A question about datasource objects in ASP.net

When using DataSources in ASP.net applications, paging and sorting along with GridView only works out of the box when using DataSet, DataTable, DataViews if you are using anything else you need to
9067

good resources for learning Orca

have downloaded Orca to edit an MSI file. I want to remove some banner text during the installation. I have managed to do this to the MSI and saved it with the MSI. However am having problems in sa...