.net

Restrict multiple instances of an application

Hi, Okay, so i've created my c# application, created an installer for it and have it working installed on my machine. The problem is, when the user opens the application exe twice, there will be two instances of the application running. I only ever want one instance of the application to be running at any time, how do I go about doing ...

In .NET, is there any advantage to a try/catch where the catch just rethrows

Possible Duplicate: Why catch and rethrow Exception in C#? I sometimes come across C# code that looks like this: try { // Some stuff } catch (Exception e) { throw e; } I understand its possible to do something like log the exception message and then rethr...

How to get width of button in DateTimePicker-Control/Controls in general?

Hello everybody, I implemented a custom DateTimePicker. On the DateTimePicker there is a button. In the examples I've found it's width is set to 16. This is working but I would like to have a dynamic approach. So, is there a way to get the size of this button or is there a general way to get information about .Net-Control sub elements ...

ASP.NET Update Panel stops jquery from working

I have binded jquery events set for mouseenter mouseleave, as well as jquery draggable. The divs are placed in an update panel and when a button is clicked information is sent to the database and the update panel is updated. However when the panel is updated the jquery events no longer work. Any idea as to why this would be the case? ...

Any good resources for the 70-536 TS: Microsoft .NET Framework - Application Development Foundation exam

Possible Duplicate: MSCT Certification, Exam 70-536, your advices? Duplicate of several, for example: MSCT Certification, Exam 70-536, your advices? Any good resources for the Exam 70-536 TS: Microsoft .NET Framework - Application Development Foundation exam. Anyone taken this exam before. Any advice. Other than read the offi...

SQLDataSource vs ObjectDataSource

If a web page needs some data, why not just have a SQLDataSource call a stored procedure? Why use an ObjectDataSource to call a business object that then calls the stored procedure? I understand that other apps (lets say desktop apps) built on the .net framework can access the business objects, but what if the application will always be ...

How do I modernize this process?

I'm looking to modernize our somewhat archaic process of receiving forms and entering them into our system. I've managed to convert our tracking system (where the forms are entered) to c# .net from classic ASP, so any solution should be based on something I could do using .net so I can integrate the two. First, I'll lay out the current ...

Resizing a WinForms textbox control based on MaxLength

I've got a situation (a key-based search) where I'm going to have multiple inputs of varying, but constrained, length. So I'm building a common control to use for each input, and this control has a TextBox for use when the input type is free-form text. In that case I'd like the length of the TextBox to reflect the constraint placed on th...

Exception on C# - but program still works

Here's what's going on. I'm opening a file on FTP that exists using a WebClient. The file exists and the function has worked in the past, but now for some reason throws an exception. (System.Net.WebException: The remote server returned an error: (550) File unavailable (e.g., file not found, no access).). The funny thing is, the script st...

Suggested design pattern for email templates?

From the "It must have been done 1 million times before" department...I need to integrate a email templating solution into an existing .Net product. Right now, each component (workflow, admin, etc) sends out their own hard-coded emails. I would like to introduce a new admin site/screen that allows users to pick from a set of email temp...

Does MethodBase provide file name and line number?

I'm trying to write a CompileTimeValidate(MethodBase method) for postsharp. the problem is when a violation occurs it only shows Description in the Error List. The 'File' and 'Line' columns are empty. The only info that I get to work with is a MethodBase instance of the method that the attribute was applied to. is there a way to get th...

Listening to a port securely using .NET 3.5

I want to listen to a port on a server, and securely process the files. Are there any standard ways to listen in .NET 3.5 or any recommendations. The data is coming from a 3rd party tools and we can route the outbound to any port. Any Ideas and recommendations. Can WCF be used?. ...

.Net Printing from a web site??

Scenario- I have a website that tracks/manages data stored in a DB(I know this covers 90% of websites :)). I have users that need to print specialized labels and barcodes. The app will need to print to a specialized Zebra RFID printer as well as a specific printer for bar codes. All users must use IE 7. Only 3-4 users will print these...

Accessing the Sharepoint Lists Web Service from .NET

I have an InfoPath form with custom submit code to update a Sharepoint list by calling the Sharepoint Lists web service. The code runs without any exceptions, and I was able to set breakpoints to make sure that the variables contain the correct values before being sent to the web service. The values never get added to the Sharepoint li...

When should I use .net Framework data types versus language datatypes?

When should I use: Int32 myint = 0;//Framework data type vs int myint = 0;//C# language data type What are the similarities/differences? I seem to recall being told that there are performance differences? Is this true? ...

document.readyState == "complete" is always false. The state is always "interactive".

I am wiring a startup script JavaScript function on Page_Load to fire like so: ScriptManager.RegisterStartupScript(Me, GetType(Page), "page_init", "page_init();", True) This function calls a couple of different functions to setup the page. One of those functions checks the document.readyState and makes sure it's "complete". This deals...

Why can't perfmon see instances of my custom performance counter?

I'm creating some custom performance counters for an application. I wrote a simple C# tool to create the categories and counters. For example, the code snippet below is basically what I'm running. Then, I run a separate app that endlessly refreshes the raw value of the counter. While that runs, the counter and dummy instance are seen...

log4net - any filter for logging only the Nth message?

I have a component that is constantly reading a values from a device. Currently it updates every {n} seconds and logs a debug message with the value to an instance of ILog. Every second is too frequent for me, I just don't care and it eats up too much log space. However, I would certainly be interested in capturing every 10th or 30th ...

How to transfer tables/databases between two remote T-SQL Servers programatically in .NET?

I think the question explains itself ...

Modular Design where Modules differ greatly

Lets say I have 3 Widget automated factories: FactoryA, FactoryB, and FactoryC. I am to develop and maintain a .Net application that facilitates the automation of these factories (motion control, mechanical positioning, etc.). This application must have the same interface for the 3 factories, but these factories are vastly different in ...