.net

What is this exception ?

I am getting this exception while reading the shapes in excel sheet in c#: on code line of if (worksheet.Shapes.Count >= iCurrentRowIndex) { } Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel._Worksheet'. This operation failed because the QueryInterface call on the COM...

What is a good buffer size for socket programming?

We are using .Net and sockets. The server is using the Socket.Sender(bytes[]) method so it just sends the entire payload. On the other side we are clients consuming the data. Socket.Receive(buffer[]). In all the examples from Microsoft (and others) they seem to stick with a buffer size of 8192. We have used this size but every now and th...

How can i use RDLC Report without installing Report viewer.exe on the hosted server

I have created a asp.net Report server web site using .net frame work 3.5 sp1 currently hosting application on Rackspace Cloud where they don't allow reportviewer.exe to be installed on the Server. So is there a solution where i can used the Rdlc report without installing ReportViewer.exe. N...

In FitNesse, can variables be defined in terms of other variables?

In FitNesse, can variables be defined in terms of other variables? I want to do the equivalent of: int a=3; int b=a; To make this concrete, I have a variable defining the date: !define clock.date {2/2/2009} I then want to define some other variable ${other.date} based on it, something like: !define other.date {...

Oracle - Parameterized Query has EXECUTIONS = PARSE_CALLS

We have a .NET application talking to Oracle 10g. Our DBA recently pulled a list of queries where executions is equal to parse_calls. We assumed that this would help us find all of the unparameterized queries in our code. Unexpectedly, the following query showed up near the top of this list, with 1,436,169 executions and 1,436,151 par...

What should I expect from calling `Cancel` on `PrintEventArgs` from `PrintDocument`?

I had to modify the print feature in our application in order to not print some specific pages. The only way I found that didn't requires heavy modifications was to recycle the page (I only know if the page need to be skipped after I "printed" it so I clear this page I use it again for the next). The problem is when the page I need to re...

Visual studio testing for foreign locales

Hi, Over the next few days I will try to migrate one of our applications so that it supports different locales. So far, I have just gone into "control panel -> region and Language" and in the "formats" drop down, I selected the locale I needed to test in. Since the application does not require any data input (well not for the first ph...

Problem consuming a dataset via a .NET web service from Flex-ActionScript

Hi, I am returning a .NET dataset to Flex Actionscript via a web service. Actionscript snippet as follows: var websvc:WebService = new WebService(); websvc.useProxy=false; websvc.wsdl = "http://localhost:13229/test/mysvc.asmx?WSDL"; websvc.loadWSDL(); var operation:Operation = new Operation(null, "GetData"); operation.arguments.command...

How to stop an application?

I have an application and from this application I have to start another process by shutting down the current application and after the completion of the process again start the application. The flow is as follows, suppose I have an application app.exe, and another application another.exe, so i have to do following: 1) Start app.exe 2) ...

C# Remove all empty subdirectories

I have a task to clean up a large number of directories. I want to start at a directory and delete any sub-directories (no matter how deep) that contain no files (files will never be deleted, only directories). The starting directory will then be deleted if it contains no files or subdirectories. I was hoping someone could point me to...

Can I create an alias in C# or VB.NET within method scope?

Is there any equivalent to an aliasing statement such as: // C#: using C = System.Console; or: ' VB.NET ' Imports C = System.Console ...but within method scope -- rather than applying to an entire file? ...

Separation of business logic

When I was optimizing my architecture of our applications in our website, I came to a problem that I don't know the best solution for. Now at the moment we have a small dll based on this structure: Database <-> DAL <-> BLL the Dal uses Business Objects to pass to the BLL that will pass it to the applications that uses this dll. Onl...

NNTP usenet download messages

I would like to download usenet messages to my personal Mysql database, so without using any newsreader. At the moment i'm using IpWorks component for .NET . I've created a simple app in Vb.Net, It works, but it's realy slow... to download and to do the INSERT INTO . Anyone know some better method to "massive" download message and inser...

Does MEF require .NET 4?

I am using Visual Studio 2010, try to create a MEF application. Does this require .NET 4.0 or can I target .NET 2.0? ...

scheduled task or windows service

Hello, I have to create an app that will read in some info from a db, process the data, write changes back to the db, and then send an email with these changes to some users or groups. I will be writing this in c#, and this process must be run once a week at a particular time. This will be running on a Windows 2008 Server. In the past,...

"type not defined" exception with WF4 RC

Hi, I`m gettin the following exception while invoking my workflow (dynamically): The following errors were encountered while processing the workflow tree: 'DynamicActivity': The private implementation of activity '1: DynamicActivity' has the following validation error: Compiler error(s) encountered processing expression "TryC...

Is there a built-in way to compare IEnumerable<T> (by their elements)?

I would like to compare lists of elements of a given type, to see which list is "bigger". new BuiltInComparer<IEnumerable<int>>().Compare( new[] {3,2,3}, new[] {1,2,3}) ...would return 1 new BuiltInComparer<IEnumerable<int>>().Compare( new[] {1,2,3}, new[] {1,2,4}) ...would return -1 etc Is there any such built i...

Does Linq/.NET3.5 support a 'zip' method?

In other languages (ruby, python, ...) I can use zip(list1, list2) which works like this: If list1 is {1,2,3,4} and list2 is {a,b,c} then zip(list1, list2) would return: {(1,a), (2,b), (3,c), (d,null)} Is such a method available in .NET's Linq extensions? ...

To Wrap or Not to Wrap: Wrapping Data Access in a Service Facade

For a while now, my team and I have been wrapping our data access layer in a web service facade (using WCF) and calling it from the business logic layer. Meanwhile, we could simply use the repository pattern where the business logic layer consumes the data access layer locally through an interface, and at any point in time, we can switc...

.NET CD burning component

We are looking for a reliable 3rd party .NET component that can burn files onto a CDROM. Any recommendations? ...