.net

Are Using Interfaces Soley to Facilitate Stubing and Mocking in Unit Tests Now Obsolete?

In .NET, TypeMock Isolator and Microsoft Moles allow one to isolate any class, property, or method - be it sealed, static, protected or non-virtual. So what was impossible to mock in Moq or Rhino Mocks, now no longer is the case. I've always had some aversion with the idea of using an interface merely to be able to allow for mocking, wh...

How to parse form-data from Stream in WCF?

Hello Guys, I have a webservice that will accept stream (Image). I was able to successfully save the image but part of it is I also need to get the form-data that is part of the Stream. Do you have any idea how to achieve this? Or any suggestion perhaps to achieve same functionality. Best regards, ...

Diassemble DLL written in VB,C,C++

Hi All, I have a few DLLs which are written in VB COM, C, and C++. How can I disassemble those DLL? Please consider that the dlls are written in VB,C,C++. Thanks for reply. Jaydeep ...

ASP.NET Chart Control - Axis labels

I am trying out THIS .NET MS Chart control. Could someone who knows about it tell me how to set the axis labels without using data bindings? eg. If there are 3 columns, I am looking for something like this Chart1.AxisX.Labels = ["First", "Second", "Third"]; Thanks in advance. ...

Memory usage during update label with System.Windows.Forms.Timer control

I have a form with label that is updating by System.Windows.Forms.Timer control every 2 seconds. In task manager i see that memory usage is growing even if program is doing nothing(but label is still updating with latest info, that is memory usage for example) Example code for label text: tlblRam.Text = string.Format("Ram: {0} MB", Conv...

Dual enumerators, second one via interface- type collisions on implementation

I have a generic class that implements IList public class ListBase<T>: IList<T>, IListBase{ IEnumerator<T> GetEnumerator(){ .... System.Collections.IEnumerator GetEnumerator(){ return GetEnumerator();} } The IListBase is an interface I use to access methods on this class for cases where I don't know the type of T at runtime. ...

exception while adding multiple rows to datatable. Couldn't store <System.Data.DataRowCollection>

idLocals is Primary key in database Populating the datatable oDtLocalCharge = bll.GetData(); i am copying the datatable in another function dtLocalCharges = oDtLocalCharge.Copy(); and trying to add rows using below code DataRowCollection drr = oDtLocalCharge.Rows; dtLocalCharges.Rows.Add(drr); When i try to add rows to dat...

Entity Framework/Linq to SQL: Skip & Take

Just curious as to how Skip & Take are supposed to work. I'm getting the results I want to see on the client side, but when I hook up the AnjLab SQL Profiler and look at the SQL that is being executed it looks as though it is querying for and returning the entire set of rows to the client. Is it really returning all the rows then sortin...

Automation vs Control - .Net Entity Framework 4 vs Custom Solutions

I've been a heavy user of .Net since its inception, but I have avoided using any of its ORM features, regardless of flavor. I have always been skeptical of tools which abstract CRUD, binding, validation, searching, etc. Some of this skepticism comes from painful, real-world experience; the rest of it comes from the innate desire to "own"...

Is there a way to dynamically reload and then reuse dll and all its classes when app is running?

My target is below scenario: I started application (Win32) The application uses a set of classes from some .NET Class library. I change some code in this .NET Class library, compile new dll In my running application i destruct all the objects from this library and reload it. My app is still running and all code changes are done! I su...

How do I return a value in for a event (bubble value up)?

I am trying to change a value in the event arguments. Not sure if this is possible, but this is my current event in the parent class: public void MasterClass() { void btnSubmit_Click(object sender, EventArgs e) { ... OnInputBound(this, new InputEventArgs(postName, value)); //I would like to try something like this ...

Graphics.DrawLine() Always Throw the OutofMemoryException in Some Condition

Here are my codes. A very simple method that handles the System.Windows.Forms.Form.Paint event. void Form1_Paint(object sender, PaintEventArgs e) { e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; PointF start = new PointF(121.0F, 106.329636F); PointF end = new PointF(0.9999999F, 106.329613F); ...

working on a big social network, what is the most efficient programming language to use ?

am collecting information to support the re-search that will help to decide which is the best programming language for my project, a team of 4 different experiment developers will start working on a new complex social network, so am looking for the language that will fit my project. 1) the project is divided into modules, that will be ...

How to create a .NET Regex with a dynamic quantifier

I am trying to extract blocks of JSON data from a data stream in the following format: Some-Header-Name:Value Content-Length:Value Some-Other-Header:Value {JSON data string of variable length} The stream contains many instances of the above pattern and the length of JSON data in each instance is different, as indicat...

How to install Excel OLE DB to Windows Server 2008?

We have a web server running Windows 2008 32-bit. When we deploy a website that reads from Excel using OLE DB, we got this error The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. We don't want to install Microsoft Office on the server. Is there anything else we can do to solve this? Thanks in adv...

Visual Studio 2010 ReportViewer Assembly References

Hi! I didn't do C# for quite some time, but I'm updating some of my projects now. I imported a project from Visual Studio 2008 into 2010. Building got me some confusing errors into the log: Considered "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.ReportViewer.Common.dll", but it didn't exist. Considered "...

WPF Set Owner on Window created on own dedicated UI thread

Hi All I have the following code, which runs a WPF window on it's own dedicated UI thread: // Create the dedicated UI thread for AddEditPair window Thread addEditPairThread = new Thread(() => { // Initialise the add edit pair window addEditPair = new AddEditPair(this); addEditPair.PairRecordAdded += new EventHandler<PairRec...

Windows Forms: Progress Bar in a DataGridView column

How can I show progressbars in the cells of a winforms datagridview column? ...

How does AppDomain initialise in a navite application which hosts .NET components.

Hi Folks, We have some .NET classes exposed as COM components. A customer has a service which utilises these COM components from a multithreaded C++ application. Things generally work fine but in some cases we are seeing issues queuing requests onto the System.Threading.Threadpool in this environment. Basically when we go to queue a user...

Visual Studio: how to debug a library with an external executable?

I am developing a class library. The library is to be used by another program, an .exe with no source code. The library file location is passed as a parameter to this exe, for example by running: prog.exe lib.dll I would like to debug the library using this .exe (using debug tools such as breakpoints, etc.) How do I use Visual C# to do ...