.net

How to disable data caching in ActiveReports 3.0 for .NET ?

I'm needing to fix a bug in an ASP.NET 2.0 app that uses ActiveReports 3.0 to generate reports from a SQL Server stored proc source. The report runs fine, but the data was incorrect, so we fixed the stored proc and reran the report through the ASP.NET interface. What we're seeing is that ActiveReports is still displaying the early ve...

Clearing DrawRectangle in Windows Forms

I am drawing a rectangle, sleeping for a few milliseconds--then I want to clear the rectangle, but I can't figure out how. (The rectangle is sitting over a graphic so I can't simply cover it up with another rectangle) graphics.DrawRectangle(p, innerRectangle) System.Threading.Thread.Sleep(75) ...

Will downlevel callers be able to benefit from optional params in assemblies produced with C# 4.0?

Suppose I have an existing assembly, and some of the classes have overloaded methods, with default behavior or values assumed for some of those overloads. I think this is a pretty typical pattern; Type2 _defaultValueForParam2 = foo; Type3 _defaultValueForParam3 = bar; public ReturnType TheMethod(Type1 param1) { return TheMethod(pa...

Linq-to-SQL Executing NonQuery

Is it possible to use Linq-to-Sql to execute a stored procedure that does not return an output? ...

Update Winforms UI from background thread result

This is probably a silly question, but I could not find an answer on stackoverflow. I have a button click event in a Winform app that runs a thread to caclulate a result to display in a form. How do I update the Forms UI when the thread has calculated the result? private void btnRequestR2Approval_Click(object sender, EventArgs e...

Why will this timer not start in a .net service application?

I have this code for a Windows service I am writing in .NET....However the TICK function never gets executed regardless of what interval I put in the tmrRun properties. What am I missing? I am sure its something stupid I am not seeing. Thank You Imports System.IO Public Class HealthMonitor Protected Overrides Sub OnStart(B...

How can I use VIM to do .Net Development

I have been researching coding editors but everytime I run up against some issue that is 1/2 coded or in the process of getting better. VIM offers everything in terms of a real powerhouse tool without all the UI fluff. What I want to know is how can I use it to build and compile .Net projects, .cs fro within VIM without shelling out to...

Get the Current User in asp.NET MVC so I can check what to do in User Controls

I am using ASP.NET MVC for a project. I use a lot of User Control and I need to check the current user and the check if it has the roles etc, now I create the user in every UserControl I see the Permissions. I want to change that so I create it only once. the Question is Whta is the best aproch? viewData["User"] = user and the get the ...

Differentiating between generic and non-generic version of overloaded method using reflection

I'm having some trouble using reflection to differentiate between a non-generic and a generic method on a generic class. Here's a test case I'm working with: public class Foo<T> { public string Bar( T value ) { return "Called Bar(T)"; } public string Bar( int value ) { return "Called Bar(int)"; } public static void CallBar<TR>(F...

unmodifiablelist in .NET 4.0

From what I can tell, .NET 4.0 still lacks readonly lists. Can anyone shed light on why the framework still lacks this functionality? Isn't this one of the commonest pieces of functionality for domain drive design? One of the few advantages Java has over C# is this in the form of the Collections.unmodifiablelist(list) method, which it s...

Can Linq to SQL coexist with ADO in SQL Server Express?

I have a single-user Win Forms application that uses an SQL Server Express database via ADO.NET. I want to add more to my app, but by using Linq to Sql (while I learn Linq to Sql). I am unable to see the database in two places simultaneously. Either I can see it in the original code using ADO, or I can see it with the new code using L...

Fastest way to copy a KeyedCollection

I'm working on a C# object copy constructor, part of which involves copying the contents of a KeyedCollection into a new KeyedCollection. This is what I have implemented currently: class MyKeyedCollection : KeyedCollection<uint, DataObject> { protected override uint GetKeyForItem( DataObject do ) { return do.Key; } }...

How do I attach my application into another .Net application?

I'm trying to create a quick debugger, wherein I can attach my application to a running .net process and execute scripts from there. I'm using C#. How will I do it? Thanks :) ...

C#: is calling an event handler explicitly really "a good thing to do"?

This question is related to C#, but may be applicable to other languages as well. I have a reservation against using code such as the following: using System.Windows.Forms; class MyForm : Form { private Timer myTimer; private Button myButton; public MyForm() { // Initialize the components, etc. myTimer...

WebServices fail because (400) Bad Request because of special character.

Using Visual Studio 2008, I setup a client that uses Web Services. It has nothing to do with buffer sizes (as that is a typical response, all appropriate sizes were increased). I was using a List as the parameter of the Method. After much experimentation, I used the System.Net.WebClient to manually create a Soap 1.1 and a Soap 1.2 reque...

Find out what class invoked a method

Is there any way, in C#, for a class or method to know who (i.e. what class/ method) invoked it? For example, I might have class a{ public void test(){ b temp = new b(); string output = temp.run(); } } class b{ public string run(){ **CODE HERE** } } Output: "Invoked by the 'test' method of class...

Error after displaying a FolderBrowserDialog

I'm working a backup program and to determine the destination location, I give them the choice to type it in, or browse to it. Lately, I've been getting this error after they browse to it using the FolderBrowserDialog to set the location and the containing form is closed: Managed Debugging Assistant 'DisconnectedContext' has detected a...

Using CSLA.NET with Active Directory

Has anyone implemented Active Directory verification instead of SQL Server with this framework? Where can I find some information on this? ...

Active Directory Helper Class

Hi, Is there a Active Directory Helper Class available somewhere? Just checking before I re-invent the wheel. I need to Validate a user in AD. Get hhis/her member roles. Thanks ...

Access AD from machine not part of domain

How can I access AD from machines not on the domain. I have an app which needs to run on some machines which are part of the domain and some which are not. I assume I have to present a valid login token from the machine which is not in the domain, however the username and password must be. What book is recommended for .net and AD ...