.net

To SharePoint Or Not (as a foundation for application development)(vs ASP.NET)

I have a POV that you should only use SharePoint for application development under these conditions. 1) The application uses documents and these documents need some sort of functionality that SharePoint does extremely well (searching/indexing, sync with Outlook, etc...) If all you want is a document bucket and a list then ASP.NET or ASP...

Best ways for transfering data over the Internet (for .NET developers)

I need to read some data from a server, transfer it over the internet (no VPN), and write it to the disk of another server. I could have thought many choices, but in the end I implemented: The sender as windows service, that sends new data every X minutes The receiver as a WCF self hosted service, with WSHttpBinding. The data being tra...

redraw combobox items when expanded

I have a .net 3.5 windows application with a bound combobox. I have overridden the DrawItem event to color the background of individual items based on certain conditions. I have asynchronous threads running which update the condition values and call Invalidate() to get the combobox to redraw. This all works very well, except when the co...

App Shutdown C# Windows

hi, my C# app is still in RAM after executing Application.Current.Shutdown(); (db connection is closed before) (Application.Current.Exit += new ExitEventHandler(Current_Exit); is also used ) is there another statement to use ? the problem occurs on different Windows Xp systems and on Server 2008. kind regards, jeff ...

Regex implementation that can handle machine-generated regex's: *non-backtracking*, O(n)?

Edit: This question has considerably evolved since I first asked it. See below for two fast+compatible, but not completely fully featured implementations. If you know of more or better implementations, please mention them, there still isn't an ideal implementation here yet! Where can I find reliably fast Regex implementation? Does ...

.NET equivalent to java.util.Arrays.hashCode() function for arrays of intrinsic types?

Is there a.NET utility class equivalent to java.util.Arrays.hashCode() for arrays of intrinsic types such as int[], short[], float[], etc.? Obviously I could write my own utility class but was trying to find one already available in the .NET framework. ...

Must declare the scalar variable "@Ad1" error in VS2005 and ASP.net

I am using ASP.net 3.5 and i am getting this error. Must declare the scalar variable "@Ad1". What am i doing wrong? My Submit button Protected Sub btnUpdate_Click Try AddressSRC.Update() lblResult.Visible = True Catch ex As Exception lblResult.Visible = True lblResult.Text = ex.Message ...

How to highlight or change the color of some words in a label dynamically at runtime?

I have a label containing some text and I want to highlight or change the color of some words in the text of the label and not all of the words. It has to be dynamic. Any suggestions? It's for c# with ASP.NET in a user control in webpart in sharepoint ...

How can I make DataContractJsonSerializer serialize an object as a string?

I have a struct in C# that wraps a guid. I'm using DataContractJsonSerializer to serialize an object containing an instance of that class. When I was using a guid directly, it was serialized as a plain string, but now it's serialized as a name/value pair. Here's an NUnit test and supporting code that demonstrates the problem: privat...

Log WCF Service Calls with Parameter information

I've been using the Service Trace Viewer to analyse the WCF service calls that are made in our application but I really need to see the parameter values that are passed to the service methods? Is this possible? I've tried turning the logging to max output but still can't see anything :( ...

LinqtoSQL - clearing then inserting

Although this probably isn't best practice, I am trying to clear a series of records from a database table, and then insert a series of records - some of which may have been in the original series, and others which may be new. I'm using linqtosql in C#. Pseudo-code I have to do this is below; it fails with "Cannot add an entity with a ke...

Do Redundant Namespaces incur any overhead

Other than maintenance complexity (and I would argue there is little to none), and the fact that it is not a clean solution (this I agree with) does importing redundant namespaces in a .NET class incur any overhead in terms of memory/space/etc.? For instance, if i import My.Namespace but do not invoke any of its functionality, is the Vi...

Monitor How Often Assemblies Are Loaded From GAC

I currently have 3 servers each running different applications. Occasionally through installation misconfiguration and code re-factoring these machines are left with assemblies in the GAC that are no longer being referenced or used by anything. Are there any tools anybody is aware of to monitor / log how often, or when certain assembli...

Return JSON wrapped in a callback function from a WCF REST web service

I have a web service returning JSON, but now I'd like to modify it to allow callers to specify a callback function so the return goes from: JSON DATA to specifiedFunction(JSON DATA); The way I'm returning JSON right now is just by returning an instance of an object and having .NET do its serialization magic, if I change to just returning...

How do I use a common class between winforms client and web service?

I have inherited a large admin winforms application that shares a 'Common' library of classes for holding data with a web service. The problem I am having is that if I return a populated instance of a class from a web service call then it comes out on the client as a different type and I cannot use the other 'Common' project logic to man...

Sql Server 2005 localhost System DSN not working

Hi, I've got an C# .Net 3.5 executable that runs on a local machine and makes database calls to a server running SQL Server 2005. I've added a System DSN using the Data Sources manager on the local machine called "localserver" (with the driver set to SQL Server). When I create the DSN, I can test the connection to the server successfu...

How to "Unset" Event

If I have a combobox click event set in the designer.cs page and then at some point during the running of the program, based on some condition, I no longer want the combobox Click event to be set, how do I "unset" it? I've tried comboboxname.Click += null and I've tried setting it to another dummy function that does nothing...neither wo...

Problem with RDPSND.DLL

Hello, I have an application in Visual Basic, using .NET Framework 2.0. This application is run at the client site on thin clients using Windows Terminal Services. It is a sort of Point-Of-Sale, and makes a sound when a item is successfuly scanned. In remote desktop, we have enabled sound to be carried to the local computer. It has be...

What UML diagrams do you create for ASP.NET applications?

I work in a mid size company as a Senior dev and work on developing projects that are fairly large size (> 1 year at a minimum). Most of the architects here feel that creating UML diagrams does not justify the time involved (although we always have a ERD and some informal flowchart kinda diagram for all projects) I am looking to create ...

Calling a FoxPro Report from .Net

Has anyone out there got experience of calling a Visual FoxPro report from a .net application? They want to both see the report and print it. I have to migrate a FoxPro application to .Net and the client would like to keep the FoxPro database + reports but place a new .Net front end on it. They have extensive Fox reports that they woul...