.net

Request a 2nd url with the same HttpWebRequest obj

I want to do something like this { HttpWebRequest WebRequestObject = (HttpWebRequest)HttpWebRequest.Create("http://google.com"); WebRequestObject.KeepAlive = true; //do stuff WebRequestObject.Something("http://www.google.com/intl/en_ALL/images/logo.gif"); //more here } How do i keep the connection alive and go to m...

Refactoring method that binds controls to LINQ

I have a function that binds LINQ results to the controls on my form. The below code works but I just can't get over the feeling I should be slapped for the copy/paste aspect. Can someone help me with what i need to do to deodorize this? Thank You! private void BindDataToForm() { // Bind data to form CaseNotesData...

Good Tutorial for Interop.Excel.PivotTable

Hi, does anyone know if there's any good online tutorial for building pivot tables using Interop.Excel.PivotTable? These are the only two I can find: http://blogs.msdn.com/andreww/archive/2008/07/25/creating-a-pivottable-programmatically.aspx http://www.dreamincode.net/code/snippet1217.htm And I'm looking for more complicated example...

Is there a way to find out what's referencing my object in .NET?

Basically, I have an object that I think should be garbage-collected but it's not. I am pretty certain all references to it are gone from what I can see in the code but for some reason, it is not getting destroyed. Is there some way to find out what's holding my object hostage? There doesn't seem to be a way to do that in Visual Studio ...

C#: How do you configure for a string[] to accept input of a whole string the way the console's main entry point accepts it broken up?

Exact duplicate: Split string containing command-line parameters into string[] in C# C#: How do you configure for a string[] to accept input of a whole string the way the console's main entry point accepts it broken up? When you execute a console application made in c#, it's main method accepts any other arguments typed into it ...

How to shell execute a file in C#?

I tried using the Process class as always but that didn't work. All I am doing is trying to run a Python file like someone double clicked it. Is it possible? EDIT: Sample code: string pythonScript = @"C:\callme.py"; string workDir = System.IO.Path.GetDirectoryName ( pythonScript ); Process proc = new Process ( ); proc.StartInfo.Wor...

Running a windows service in a console

What is the best way to run a windows service as a console? My current idea is to pass in an "/exe" argument and do the work of the windows service, then calling Application.Run(). The reason I'm doing this is to better debug a windows service and allow easier profiling of the code. The service is basically hosting .NET remoted object...

Learning Oracle for the first time

I am a very experienced MS Sql developer, and a few new job positions are coming my way where I will be working with Oracle on a more daily basis. As with all the technologies I have learned, I want to know the best places and books to get started and up to speed with designing and developing with Oracle, but with pure C#. What resourc...

Determine if object derives from collection type

I want to determine if a generic object type ("T") method type parameter is a collection type. I would typically be sending T through as a Generic.List but it could be any collection type as this is used in a helper function. Would I be best to test if it implements IEnumerable<T>? If so, what would the code look like? Update 14:17 G...

Microsoft's CCR vs Task Parallel Library

Microsoft has at least two different approches to improved support for concurrent operations. 1) Is the Concurrency Coordination Runtime (CCR) which is part of Microsoft Robotics Studio and CCR & DSS Toolkit 2) Task Paralell Library (TPL) (Part of .NET 4.0 and now in Beta 1 release) I would like to know if anyone has experience with...

Accessing similar named properties in a loop

I have a .Net object (in C#) which has properties named event1, event2 and so on. I have to do some if-else on each of these. is there way i can loop over these. If these were controls i could have used the controls collection, but these are properties of an object. Any help? ...

Evaluating Sharepoint vs ASP.NET as a development platform

I am evaluating Sharepoint (not MOSS) vs ASP.NET as a development platform for an upcoming solution for our team. We will be developing a solution for broad (we hope) deployment across a variety of environments. I am identifying categories to evaluate pros / cons for each platform choice. I have picked categories that are applicable ...

ensure two char arrays are not the same

I am randomly generating a grid of characters and storing it in a char[,] array ... I need a way to ensure that i haven't already generated a grid before serializing it to a database in binary format...what is the best way to compare two grids based on bytes? The last thing i want to do is loop through their contents as I am already pul...

Biztalk FileAdapter Errror when using Dynamic Send Port and UNC

Hi, I am using a Dynamic Send Port in Biztalk 2006 and i am trying to write to a Windows Share (UNC) but get "Access is denied". The Biztalk host in-process-user got all permission needed at the given folder. I can manually create a new file in the destination but not when using Biztalk. Does the FileAdapter use another host-user ?(wh...

auto width & overflow div

Hi, I am creating some sort of grid for a project. The grid has one special requirement (that is the reason why we are trying to create one in house), the middle columns have to be scrollable. To picture the situation: We created the grid more or less like this: There is a topcontainer div, that contains 3 other divs the left middle a...

XML Documentation Comments with Interfaces and implementing class(es)

I am documenting an assembly using XML Documentation Comments, from which a chm file will be created using Sandcastle. My assembly contains various interfaces, each of which is implemented by one class (in my scenario these are WCF services). I have added documentation to the interfaces, is there any way for me to automatically documen...

What's a good brief introduction to Mono/.NET programming?

Hello, I am quite impressed by the Mono features, especially by the portability of the library. I think I'll give it a try soon or later and I'd need some directions to find an introduction to Mono/.NET programming. Can you help me? Thank you ...

How do you arrange source code elements in C# 3.0?

Does following look good? Edit: Options are general in nature, may not be exhaustive in terms of C# elements. Single Source file can contain following: Notes: Files can come in pair - Editable + Generated Single file can have only one name-space. File: Option-1 One partial or full class per file Zero or more enum per file Zero or ...

HMACMD5 in .net compact framework

How to implement HMACMD5 algorithm in .net compact framework. ...

double.Epsilon vs. std::numeric_limits<double>::min()

Why double.Epsilon != std::numeric_limits<double>::min()? On my PC: double.Epsilon == 4.9406564584124654E-324 and is defined in .NET std::numeric_limits<double>::min() == 2.2250738585072014e-308 Is there a way to get 2.2250738585072014e-308 from .NET? ...