.net-3.5

Using the C# Volatile keyword in Threaded Application

I have a class that has a few arraylists in it. My main class creates a new instance of this class. My main class has at least 2 threads adding and removing from my class with the arraylists in it. At the moment everything is running fine but I was just wondering if it would be safer to declare my class with the arraylists in it as vol...

The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state

try { String endPointAddr = "net.tcp://localhost:8000/MyService"; NetTcpBinding tcpBinding = new NetTcpBinding(); tcpBinding.TransactionFlow = false; tcpBinding.Security.Transport.ProtectionLevel = System.Net.Security.ProtectionLevel.EncryptAndSign; ...

Allow only alpha characters into textbox in asp.net

How can I prevent the user from entering anything but alpha characters in my textbox? Update Forgot to mention that its a dynmic control (created on the form when the user clicks a button). ...

How do I properly style a button in WPF?

I know this is a basic question, but I'm having a bit of trouble understanding how to do this properly. Given the following XAML: <Button> <Grid Grid.Row="1"> <Grid.ColumnDefinitions> <ColumnDefinition Width="16" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Image Grid...

Getting a line # and proc name in asp.net

I am writing an error log procedure (for security reasons I cannot use log4net / elmah etc), and I wanted to know if it is possible to get the line number of the line where the error occured and / or the procedure name where the error occured? I will be creating try catch finally statement blocks, so I am hoping to get the line number of...

Virtualizing WPF Wrap Panel Issue

There are not very many options for a virtualizing wrap panel for use in WPF. For one reason or another MS decided to not ship one in the standard library. If anyone could be so bold as to provide a crowd source answer (and explaination) to the first work item on the following codeplex project, I would greatly appreciate it: http://vi...

Comparing 2 CSV files in C# advice?

I need to develop an application where two csv files are compared. The first file has a list of email addresses. The second list also has email addresses, but includes name and address info. The first list contains email addresses that need to be removed from the second list. I have the Fast CSV reader from the CodeProject site which wor...

How to always show the first and the last AxisX Label with Microsoft Chart Controls?

I'm developing a stocks evolution chart with Microsoft Chart Controls and I need to show the initial and final dates on the AxisX labels but I can't do it. I google and found many solutions like set the properties: Chart1.ChartAreas[0].AxisX.Minimum = InitialDate.ToOADate(); Chart1.ChartAreas[0].AxisX.Maximum = FinalDate.ToOADate(); C...

Linq - Query a List<string[]>

How do you query a List<string[]> to get the index of the arrays having matches on their sub-arrays and get a return of type System.Collections.Generic.IEnumerable<string[]> ? EDIT: I have this: string[] report = File.ReadAllLines(@".\REPORT.TXT").AsQueryable().Where(s => s.StartsWith(".|")).ToArray(); List<string...

CallBack in WCF?

How we use CallBack in WCF fluently with events and delegates? If Client give any request or any conditions matches of client then services automatically fire the event which condition or request given from client. how is it possible? ...

DataServiceConfiguration inaccessible?

Hey all! The following code worked previous to the Vs2010 upgrade... using System.Data.Services; namespace Nla.Dashboard.Web.Services { public class DashboardDataService : DataService<NlaPrimaryEntities> { // This method is called only once to initialize service-wide policies. public static void InitializeService(DataServiceCo...

How do I activate stack tracing in asp.net

I am new to .net and wanted to know how to activate stack tracing in .net? ...

some questions on migrating ASP.NET 1.1 application to 3.5

Hi, I need to migrate a ASP.NET application from 1.1 to 3.5. I have gone through the answers on this forum already, but still have some questions should I convert the application from 1.1 to 3.5 directly? OR convert it to 2.0 first and then to 3.5 and the reasons for doing so. Is there any article that walks through the whole convers...

how to use hovermenuextender in asp.net 3.5 vs 2008

how to use hovermenuextender in asp.net 3.5 vs 2008 ...

Prioritising Event Handlers

I have the following code where I am handling an event twice. However I always want to ensure that mynewclass always handles the event first and then the local event handler code fires. I understand the MyClass event should fire first as that is the one created first but because the thread and enqueuing is taking place, I think its tak...

C# Generic Methods, New Constraint

Hi, Is there a way to create a Generic Method that uses the new() Constraint and only accepts constructors of a given type? Example: I have the following code: public T MyGenericMethod<T>(MyClass c) where T : class { if (typeof(T).GetConstructor(new Type[] { typeof(MyClass) }) == null) { throw new ArgumentException("I...

Using generics to specify the concrete and base type in .NET 3.5

I have created a generic method that enables clients to specify both the concrete type of the returned instance and the actual returned type (e.g. an interface) as independent type parameters. Naturally, the concrete returned instance type parameter is constrained to inherit from the actual returned type. The idea is that you may return...

Confused about resources in a .NET project

I am trying to remove a massive amount of cruft from a .NET 3.5, VS2008 project and I am somewhat confused as to what gets compiled into an EXE and what isn't. So for instance, if I double click on my Resources.Resx file, i get the following: As you can see it states that this bitmap is "Linked at compile time". However, when I go t...

How to do interpolation

I have very little data for my analysis, and so I want to produce more data for analysis through interpolation. My dataset contain 23 independent attributes and 1 dependent attribute.....how can this done interpolation? ...

Problem starting process in asp.net (IIS 6.1)

I have one asp.net simple page, on button click I'm trying to start one process(.net console application) but I'm having access denied exception.. If the process is simple windows applications like notepad.exe, or anything else "not .net assembly" the code works... The problem only happens when I'm running the code from IIS, but from Vi...