.net-2.0

Continuous Integration Fix for NAnt 0.86 Beta 1 with .NET 3.5

Hi All, I have been trying to use the latest NAnt (0.86 Beta 1) for a few weeks now in several .NET 3.0/3.5 projects as using multiple .sln solution files to build the platform code on my build server but alws ran to error and having this problem : BUILD FAILED Solution format of file 'C:***\Platform.sln' is not supported. ...

DataTable to JSON

I recently needed to serialize a datatable to JSON. Where I'm at we're still on .Net 2.0, so I can't use the JSON serializer in .Net 3.5. I figured this must have been done before, so I went looking online and found a number of different options. Some of them depend on an additional library, which I would have a hard time pushing thro...

HttpWebRequests Failing on Subsequent Calls

Hi, I know this is a vague question, especially since I am not providing any code, but I am developing a .Net 2.0 application, and we have a WebRequest which posts data to an internally built API. The strange thing happens on our 3rd (and always the 3rd) subsequent request which fails at the GetRequestStream() method of the request. Th...

c# Read line from PDF

Hi, for some monitoringproject I want to be able to read line by line from a pdf, compare it to a string( a filename), and if the string appears in that line, write that line to a list. So far I had a quick look at ITextSharp and at PDFSharp, but it doesn't seem like these are the right tools for the job as they focus most on altering ...

Determine why Bound Data is not available at PostBack

I've got an ASP.NET GridView that's been extended to provide a "row click" functionality. I data bind anywhere from 1 to 10 records and display it to the user. The bug I'm hitting is that the control will not have any data associated with it on postback. I have observed this behavior only when I click on a row before the rest of the...

Looking for a Visual Studio toolbox style navigation for desktop applications

I'm working on a project that uses an MDI application with a navigation panel on the side. Currently it is a ListView. However, I would like to redesign it to be similar to the toolbox in visual studio 2008. If this is something that would require overriding the default paint method, it would also help if you could provide some good ref...

Is (HttpContext.Current.User != null) enough to assume that FormsAuthentication has authenticated the user

In an ASP.NET (2.0) application I use FormsAuthentication. In the Global.asax / Application_AuthenticateRequest method I check if HttpContext.Current.User is null. Is this enough to know if the forms authentication cookie exists, the ticket is not expired, and overall, that the forms authentication mechanism has done its job to validat...

Stored procedure causing timeout only when run from application

Hi, We have runned into a problem with an sp. We have a pretty simple sp containing a declared table and a couple of outer joins that in the end returns between 20 and 100 rows. Since querying this sp has been giving us poor performance both in production and in testenvironment we recently rewrote it to be more efficient and has teste...

In C# What is the best way to parse Large XML (Size of 1GB)...?

I am having a 1GB XML File and want to parse it.If i use XML Textreader or XMLDocument ,result is very slow and some times hangs ...Your answers are welcome ...

Winform Not Displaying in Designer

I have a Managed C++ WinForm that suddenly stopped showing in the VS 2005 designer. The error it shows is Could not find type 'int'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built. I don...

.NET2.0 C# Interop: How to call COM code from C#?

In my last development environment, I was able to easily interact with COM, calling methods on COM objects. Here is the original code, translated into C# style code (to mask the original language): public static void SpawnIEWithSource(String szSourceHTML) { OleVariant ie; //IWebBrowser2 OleVariant ie = new InternetExplorer(); ...

Simple SQL statement builder for .Net

I've jumped into an ongoing .Net 2.0 web app project for a larger company as a freelancer. Their DAL has lots of functions that manually construct and execute SQL statements -- many of them are long, messy and as a result difficult to understand and debug. I wrote a simple "sql helper" that lets me write things like this: sqlh.addValue...

starting a program on a remote machine in wmi, but also opening the apps window (in c#)

I've browsed page after page after page of data on the web and everyone seems to say that you cannot have an executable remotely execute an application on another machine via WMI and have the window of that application display. Does anyone know a way around this? I have tried created 2 executables. 1 executable uses the Process class a...

Passing custom objects between C# and unmanaged C++

I have a legacy DLL which contains a couple of methods I need to call from C# code. One of these methods takes in a pointer to another C++ class that lives within other C++ programs, not the DLL. I'm pretty sure I need to use pinvoke to marshal the objects back and forth, but I haven't found anything on marshaling custom objects. ...

Cross referencing multiple objects

Ok, so I'm having a hard time coming up with a 'good' way to do the following: Group 4 objects so that if I Object A I can easily and without having to go through Objects B & C to find out if Object D relates to Object A. As well as any other combination of referencing. I am currently using SortedLists to link A to B and B to C and C t...

Method chaining generic list extensions

I have a List of a "complex" type - an object with a few string properties. The List itself is a property of another object and contains objects of a variety of types, as shown in this abbreviated class structure: Customer { public List<Characteristic> Characteristics; . . . } Characteristic { public string Characterist...

VB.NET (Of T) Comparison Operator

In the sample code, the line with the 'error comment' gives the following the error - Operator '<' is not defined for types 'T' and 'T'. Why wouldn't VB automatically call the appropriate T operator? (i.e. If T is an integer then call the integer comparison functions.) Is it possible to make this work in an elegant fashion? This i...

Array.Join in .Net?

Ok, this is a dumb thing that I'm sure I've done dozens of times but for some reason I can't find it. I have an array... And want to get a string with the contents of that array separated by a delimited... Where is the .Join() method that I can't find? (This is .Net 2.0, I don't have any LINQ stuff) Thank you! ...

Compact Framework - Disable Mouse Events during loads

Morning all, I design a number of compact framework applications, and something that always eludes me is a way of preventing what we call yorkshire bank syndrome (ybs). YBS is named lovingly after the cash points at Yorkshire Bank due to the fact that their screen refresh is so slow, and one of my colleagues pressed the button twice thi...

Client found response content type of 'text/html', but expected 'text/xml'

I am getting this error: Client found response content type of 'text/html', but expected 'text/xml. I am adding web reference for live search. When i build the project its Successful. But after that once i enter some text in textbox & enter search button it gives this error. I am Using my local machine & Using .net 2.0 with C#. Plz...