I have an application (asp.net 3.5) that support 4 different languages. Along with other cultural changes, the date formats must match the current culture on out reporting pages.
We set the date formats of each of the textboxes like:
string date = DateTime.Today.ToString("d"); //returns the date portion only
textbox1.Text = date;
tex...
About 30 minutes of troubleshooting and it turns out the person who's trying to use my application doesn't have the newest version of the .NET Framework. Is there a way or some KB article which describes a best practice for informing users who are not updated or do not have the framework, etc.
Thanks!
...
Every now and again I find myself doing something moderately dumb that results in my program allocating all the memory it can get and then some.
This kind of thing used to cause the program to die fairly quickly with an "out of memory" error, but these days Windows will go out of its way to give this non-existent memory to the applicati...
I have a server that has several clients C1...Cn to each of which there is a TCP connection established. There are less than 10,000 clients.
The message protocol is request/response based, where the server sends a request to a client and then the client sends a response.
The server has several threads, T1...Tm, and each of these may se...
How should I go about collecting exceptions and putting them into an AggregateException to re-throw?
For my specific code, I have a loop and will have zero or more exceptions thrown from a part of the code. I was hoping to just add the new exceptions to the AggregateException as they arise, but the documentation sort of indicates that i...
So, this is a pretty basic question I hope.
I have a web service that I've added through Add Service Reference. It has some methods to get list and get detail of a perticular table in my database.
What I'm trying to do is setup a UI as follows:
App Load
Load service proxy
Call the GetList(); method display the results in a ListBox c...
I'm working with a customer whose web service doesn't return the data in every case. Since the C# stub code is generated by calling wsdl.exe, I'm wondering how to get the actual URL used for any particular method call. I would like to feed the URL to a browser to show them (aka point fingers).
...
I've created a custom clipboard because it's not possible to make my whole class map serializable - which is a requirement for the windows clipboard.
However, I need to distinguish between users who are using my clipboard through a unique id. Basically, I want to be able identify a person who is sat at one PC with one or more copies of ...
I have a Windows context menu item invoking a Windows Form via these registry keys...
HKLM\Software\Classes\*\shell\myappname
HKLM\Software\Classes\*\shell\myappname\command
But when my Windows Form is started, I want it to be located near where the context menu was invoked. Is there any way to do that? I think I need to get the coo...
In our production environment, our WCF services are serialized with the XMLSerializer. To do so our service interfaces have the [XMLSerializerFormat] attribute. Now, we need to change to DataContractSerializer but we must stay compatible with our existing clients. Therefore, we have to expose each service with both serializers.
We have ...
It's easier to write
intArray1.CopyTo( intArray2, 0 )
than the for-loop equivalent, but System.Array does not provide any generic Copy/CopyTo methods.
Is it better to write the for-loop? Or is using Copy/CopyTo compiled or JIT'd efficiently enough?
...
Background
While running benchmark tests this morning, my colleagues and I discovered some strange things concerning performance of C# code vs. VB.NET code.
We started out comparing C# vs. Delphi Prism calculating prime numbers, and found that Prism was about 30% faster. I figured CodeGear optimized code more when generating IL (the ex...
Hi,
I have a function that takes a byte[] as input and returns a string, when executed with a windows application takes 3 seconds to execute, while if the same function is executed within a webservice takes a very large amount of time to execute (more than 1 min).
Do I need to enable something?
...
I have the following code. When i refresh my datagrid the row select is still select (note i only have one select row at a time which is why selectIndex is one value and not a list).
The problem is when i move my arrowkey up or down it starts from the beginning of the datagridview and not the row selected.
var ret = dataGri...
I have a scenario where I need to show a different page to a user for the same url based on a probability distribution,
so for e.g. for 3 pages the distribution might be
page 1 - 30% of all users
page 2 - 50% of all users
page 3 - 20% of all users
When deciding what page to load for a given user, what technique can I use to ensure th...
This is not browser specific - the behavior exists in Firefox and IE. The RadControl is being used within a User Control in a SiteFinity site.
Very little customization has been done to the control.
<telerik:RadDateTimePicker ID="RadDateTimePicker1" runat="server"
MinDate="2010/1/1" Width="250px">
<ClientEvents></ClientEvent...
Hi,
I need to create a program that creates another program but not a compiler though.
For example,
I write a program that accepts a string input from the user. Let's say user enter "Pluto". This program should then create a separate .exe that says "Hello Pluto" when executed.
How can I do this? If you could give example in C# and Wi...
I'm leveraging the Doubleton Pattern from the Doubleton Design Pattern on Code Project in my own code. I think it makes things a lot easier since the Singleton only provides one instance, but I get two with this pattern. I was wondering if it would make sense to have it implement an interface so I can inject it into my domain layer.
...
I am looking for a messaging/eventing framework that will allow changes in one application to be subscribed to by other applications. My situation is I have an ASP.NET web application that allows users to perform CRUD operations. I also have multiple unknown applications that are used to synchronize data in our application with data in...
I have an object that contains tons of data used for reports. In order to get this object from the server to the client I first serialize the object in a memory stream, then compress it using the Gzip stream of .NET. I then send the compressed object as a byte[] to the client.
The problem is on some clients, when they get the byte[] a...