.net-2.0

How can I force my Dataset using application to reconnect and prevent timeout error?

How can I force my Dataset using application to reconnect and prevent timeout error?
Brief questionWhat command can I use to make my DataSet refresh it's connection to the SQL Server before I go on to work with the DataSet object? I'm working with C# in .Net 2.0Much longer version of the same question with specificsI have a database

How to Xml serialize a LinkedList?

How to Xml serialize a LinkedList?
.NET 2Actually there are methods to XML serialize aList<T>. What if I have an object that has a publicLinkedList<T>member?Without creating a public duplicate asList<T>fromLinkedList<T>. Maybe a way to control the Xml serialization

DataGridView binding problem: “Index -1 does not have a value.”

DataGridView binding problem: “Index -1 does not have a value.”
I have a datagridview bound to a binding source and a couple buttons on a form. One button adds an item to the binding source, the other removes the currently selected item. There's also an event handler that listens to the CurrentChanged event and u

How can you apply the Adapter Pattern to a Collection?

How can you apply the Adapter Pattern to a Collection?
Given the two classes below, how can I convertList<Person>toList<Person2>?EDIT:This is a fabricated example. The point I'm trying to make is that I can't modify thePersonclass, and we'll knowarbitraryNumberwhen we instantiateList<Person2>

How to build XmlNodes from XmlReader

How to build XmlNodes from XmlReader
I am parsing a big number of big files and after profiling my bottleneck is:XmlDocument doc = new XmlDocument(); doc.Load(filename);This approach was very handy because I could extract nodes like this:XmlNodeList nodeList = doc.SelectNodes("myXPath&q

Fastest way to check a List for a date

Fastest way to check a List for a date
I have a list of dates that a machine has worked on, but it doesn't include a date that machine was down. I need to create a list of days worked and not worked. I am not sure of the best way to do this. I have started by incrementing through all the

Can I have a 4.0 NET Project in a 2.0 NET Solution?

Can I have a 4.0 NET Project in a 2.0 NET Solution?
I have a solution with a bunch of 2.0 vb library projects and I want to add a 4.0 c# library project, so I can reference one of the vb projects in my c# project. Is this possible?It depends what you mean by "2.0". If you mean they're projectstar

Invalid postback or callback argument. Event validation is enabled using ''

Invalid postback or callback argument.  Event validation is enabled using ''
I am getting the following error when I post back a page from the client-side. I have JavaScript code that modifies an asp:ListBox on the client side.How do we fix this?Error details below:Server Error in '/XXX' Application. -------------------------

Writing an IDAT png chunk using C#

Writing an IDAT png chunk using C#
I'm trying to create a simple 8-bit png writer, and I've got all the chunks being written correctly except the IDAT chunk (the important one). I believe my problem is in the compression. I've tried using theGZipStreamand theDeflateStreamclasses to ou

Method chaining generic list extensions

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<Charac

MsgBox closes form

MsgBox closes form
In my program (form1) i call another form (form3) withForm3.ShowDialog(). This form runs a relativly long process that is tracked by a progress bar. In this form there is a button to cancel this process(generate pdf document) and revert the process.T

Can ConfigurationElementCollection object contain for its elements another ConfigurationElementCollection objects?

Can ConfigurationElementCollection object contain for its elements another ConfigurationElementCollection objects?
Can ConfigurationElementCollection object contain for its elements another ConfigurationElementCollection objects?I have this xml where testsection is section root:<testsection> <head> <metaData> <metaGroup id="general">

GenerateResource / CoreResGen suddenly taking almost 30 times as long

GenerateResource / CoreResGen suddenly taking almost 30 times as long
Starting a few weeks ago, compiling a project (VB.NET, .NET 2.0, VS 2010) has taken several times as long as before. In Task Manager, I noticedResXtoResources.exetaking lots of CPU for a while. I've finally been able to get some data on this using MS

LINQ Source Code Available

LINQ Source Code Available
I'm using a .Net 2 project and am missing LINQ.I cannot use 3rd party tools or try using the System.Core hack to get it to work so I was thinking that if the LINQ source code is available I could just copy the extension methods and create a class in

Windows Form ComboBox fires SelectionChangeCommitted, SelectedValueChanged and SelectedIndexChanged event when application loses focus

Windows Form ComboBox fires SelectionChangeCommitted, SelectedValueChanged and SelectedIndexChanged event when application loses focus
I have .Net 2.0 Windows form containing combobxes. I have written following code to populate combobox and then binding it to ProductType property of type Int.// Populate Combo cmbProduct.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList

Load vs. Shown events in Windows Forms

Load vs. Shown events in Windows Forms
Hopefully I'm just missing something obvious, but I'm trying to get my head around the differences between the Load and the Shown events inWindows Forms.Traditionally, I've only used Load (or actually OnLoad, since I think it's cleaner to override a

How do I perform an action on a gridview column only if it exists?

How do I perform an action on a gridview column only if it exists?
I have a gridview which is in a usercontrol on a page. The gridview displays data based on whatever the calling page tells it to, which may or may not include certain columns.I want to tell the gridview how to format the columns if they're present on

DirectoryNotFoundException when accessing ProgramData on Vista - Could not find a part of the path - WinIOError

DirectoryNotFoundException when accessing ProgramData on Vista - Could not find a part of the path - WinIOError
Occasionally some users of our software report issues that are caused by wiredDirectoryNotFoundExceptionexceptions. This happens only to some users running Vista. Not all users running Vista have this problem. There were no reports of this issue from

WCF consumed as WebService adds a boolean parameter?

WCF consumed as WebService adds a boolean parameter?
I've created the default WCF Service in VS2008. It's called "Service1"public class Service1 : IService1 { public string GetData( int value ) { return string.Format("You entered: {0}", value); } public CompositeType GetDataUsingDataCont

How can my program determine if it is running on 32-bit or 64-bit Windows?

How can my program determine if it is running on 32-bit or 64-bit Windows?
Here's my question. What is the best way to determine what bit architecture your app is running on?What I am looking to do: On a 64 bit server I want my app to read 64 bit datasources (stored in reg key Software\Wow6432Node\ODBC\ODBC.INI\ODBC Data So
What Others Are Reading