.net

Where to store temporary data in an ASP.NET application.

In my web application I have a number of custom grids on a page. I want the user to be able to edit data in each grid and then press save once at the end of the process to commit their changes. So I need somewhere temporary to persist their changes before they are comitted. The grids will use AJAX/Javascript so as to not force a full pa...

How to define a default value for a field of a FileHelpers element class

I'm trying to load a CSV file (delims are ';' and quotes are '"'). I have successfully created everything (the wizard tool is awesome), but there's one thing that I can't find a solution for. Basically, I have an integer (System.Int32) column. In theory most of the records will have a positive integer value in that column. Sometimes, h...

Listening to non-verbose log entries only with enterprise library

I'm marking verbose log entries like this: Logger.Write(new LogEntry { Message = "Using debug quote id...", Severity = TraceEventType.Verbose }); How do I configure enterprise library event listener to log non-verbose events only ...

Any way to rename a deployed ClickOnce app?

My company has a ClickOnce that has been in use with our customers for about a year now. We're going through a re-branding, and want to change the name of the application. However, just changing all of the normal name options in Visual Studio, and then building a new deploy obviously changes the manifests that the existing app is lookin...

Is there a posix SIGTERM alternative on Windows? - (A gentle kill for console application)

I have a console deamon that is runned by a GUI application. When the GUI application is terminated I'd like to stop the deamon as well. How can I do it in a gentle way on windows? On Linux I would just use SIGTERM is there a similar mechanism on windows for console applications? To provide a bit more details: the deamon app is writte...

.Net Reflection Issue with Methods

I've used NDoc for quite a while now using a customised build (i.e. slightly bug-fixed build) of NDoc Enhanced (http://sourceforge.net/projects/ndoc-e/) but I've run into a strange issue with methods that have parameters which themselves take generic parameters. For example anything that has a Dictionary as a parameter where the type pa...

any way to check both request.form and request.querystring in a single call?

Is there a built in collection that checks both request.form and request.querystring ...

NullRefException when using WebServiceProxy with Powershell and WCF

I'm trying to execute a wcf service operation from PowerShell using the following script. $uri = "http://myserver.com/myservice.svc?wsdl" $proxy = New-WebServiceProxy -Uri $uri $proxy.CleanupExpiredTransactions() However, I am getting the following exception. Exception calling "CleanupExpiredTransactions" with "0" argument(s): "Object...

How can I have an SSIS job communicate with my ASP.NET MVC site?

When a certain thing happens in an SSIS job I have running, I need it to send internal messages out to users. What is the easiest way to setup my ASP.NET MVC site so my SSIS service can call some action on the site and pass in a few string parameters (recipients, etc). Should I try and use a traditional web service, or WCF service, or ...

Change column headers on datagrid. CF

How could one change the header text on a datagrid when using data binding in .NET CF? ...

is there a <key, value, value> dictionaryish type in C#?

I need something resembling the following: Dictionary<string, List<int>, List<DateTime>> = new Dictionary<string, List<int>, List<DateTime>>() are there any built in class in C# which offer something like the above? Edit: for people who can't see why anything like this could ever possibly be useful... Imagine if you co...

What strategies are used to implement type-ahead auto-completion on a large dataset?

I am a .NET WinForms/ASP.NET developer with what I think of as technology agnostic questions about how to implement "type-ahead auto-completion" on a large data set. If someone could point me to a reference implementation or detailed discussion, that would be great, but here are my questions: Presumably, the user starts typing and, aft...

Is there an equivalent to the C# "var" keyword in C++/CLI ?

In C#, I like the var keyword for situations like this: var myList = new List<MyType>(); Is there any equivalent in C++/CLI, or do I have to repeat the type name everytime just like this: List<MyType ^>^ myList = gcnew List<MyType ^>(); Could not find an explicit statement in the docs or by Google so far. I am using Visual Studio 2...

What could cause my WCF to throw strange Socket Exceptions?

Sometimes it will be a SocketException: Stack trace: at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.ServiceModel.Channels.SocketConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout) And sometimes it is throwing the following C...

Catch a C Runtime Library fatal error in (mixed) .NET code?

I have a project that consists of a C# application that calls into a couple of C++/CLI DLLs. If I have a Visual Studio C Runtime Library fatal error in the native code, there appears to be no way to catch it. To give a simple example, if I put this in the native code: wchar_t buf[1]; ::wcscpy_s(buf, 1, L"ab"); The app wil...

Is this a covariance problem? Not sure if brick wall.

I wrote ASP.NET pages which will manage forms. They're based on the following base class. public abstract class FormPageBase<TInterface, TModel> : Page, IKeywordProvider where TModel:ActiveRecordBase<MasterForm>, TInterface, new() where TInterface:IMasterForm { public TInterface FormData { get; set; } ...

Draw text with a stroke onto an image in .Net

I am currently using the System.Drawing.Graphics.DrawString() method in .Net to draw text on top of an image, and then save it to a new file: // define image file paths string sourceImagePath = HttpContext.Current.Server.MapPath("~/img/sourceImage.jpg"); string destinationImagePath = HttpContext.Current.Server.MapPath("~/img/") + "final...

.NET RegEx: Replace unsanitary characters.

Let's say I have a string that can contain any UTF-16 characters, but I want to replace all characters not in a whitelist with an underscore. Let's say the whitelist is [A-Za-z], [0-9], and [-:.]. How would I use the Regex class to replace all characters not in the whitelist? ...

Storing user access level in a database.

I am storing a list of "Users" in a table. The business logic of the application will have a reference to an object with all the data in this table for the currently logged-in user. And be able to allow the user to perform operations if they have the correct access. I'm wondering what is the best way to store "access levels?" One way I...

DataContractSerializer leaking memory untill process die

Hi guys! I have a .net4 application using EF4, I Expose my model through WCF using BasicHttpBinding (but this can be changed) that every time I try invoke this method my web server process start to grow in memory and the process die. The problem is when the DataContractSeralizer trying to serialize my Entity (has some relationships) ...