.net-2.0

Exception error message with incorrect line number

When an exception occurs to in an Asp.Net web page, an error message is displayed with the complete stack trace. Example below: Stack Trace: IndexOutOfRangeException: Index was outside the bounds of the array. MyNameSpace.SPAPP.ViewDetailsCodeBehind.LoadView() +5112 MyNameSpace.SPAPP.ViewDetailsCodeBehind.Page_Load(Obj...

C# - Get Field Types

In a C# 2.0 I have a list of fields and a list of values (stored as strings), a table name, and an ODBC Connection. I need to get the data types of the fields that are on that table, so I know how to generate my sql. What's the best way to get that information from what I've got? My only idea is to do a SELECT TOP 0 * FROM @TableNam...

How do I programmatically get the GUID of an application in .net2.0

I need to access the assembly of my project in C# .NET2.0. I can see the GUID in the 'Assembly Information' dialog in under project properties, and at the moment I have just copied it to a const in the code. The GUID will never change, so this is not that bad of a solution, but it would be nice to access it directly. Is there a way to ...

Automatic creation of ListViewSubItems

Hai, I tried to create a ListViewControl (tile mode) and added a ListViewItem. I created it like this, ListViewItem aFooItem = new ListViewItem("foo"); listView1.Items.Add(aFooItem); //Adding the ListViewItem to the ListViewControl Now I ran the application and tried to debug the first line. I found that the aFooItem's subitems cou...

Crystal Reports hanging

The company has recently implemented software not written by us. The software uses Crystal Reports and whenever somebody draws a particularly large report and close their browser before the report is finished loading, we cannot draw anymore reports. The only way to fix it is to reset iis which is obviously exceptionally bad practice. An...

How do I make a WinForms app go Full Screen

I have a Winforms app that I am trying to make full screen (somewhat like what VS does in full screen mode). Currently I am setting FormBorderStyle to None and WindowState to maximized which gives me a little more space, but it doesn't cover over the taskbar if it is visible. What do I need to do to use that space as well? For bonus p...

Hashtable insert failed. Load factor too high. - ASP.NET 2.0

I received the following error while trying to login to a secured directory. As far as I know there are no large hashtables in use. The user login information is in the web.config file. Notice this is happening in .NET 2.0. I've searched and found references to this occurring in .net 1.0 or 1.1 environments but I haven't found a solution...

Update programmatically xml with C#

i try to update xml without linq (i am using VC 2.0). My xml file format: <schedule> <id>0</id> <name>yusuf</name> <status>0</status> </schedule> AFTER UPDATE: <schedule> <id>0</id> <name>yusuf</name> <status>1</status> </schedule> but i do not have any idea update status =0 to status =1 ...

Button image too far from top of button; too close to bottom of button

I'm working on a Windows Form in VB.NET 2005 and I would like to have some buttons with images (I'm talking about the plain, vanilla System.Windows.Forms.Button). I have everything set up the way I want it but the images are displaying too low on the button, such that the bottom of the icon is almost right on the bottom of the button an...

What's the easiest way to verify there's an available network connection?

Hi, I'm a bit of newbie to c#/.net development, but I've put together a stock tracking application for a small set of assets in my company. I have also set up the database it connects to in SQL 2000. It currently works brilliantly when a network connection is available, but I want to expand it for use when I'm away from a connection. ...

Set properties on dynamically added UserControl

I'm dynamically adding a custom user control to the page as per this post. However, i need to set a property on the user control as i add it to the page. How do I do that? Code snippet would be nice :) Details: I have a custom user control with a public field (property ... e.g. public int someId;) As I add a UserControl to a page,...

Is there a predefined class for 3 linked values like the Hashtable?

Is there a built in object that handles 3 linked values in a similar fashion to the hashtable? i.e. Key, Value1, Value2? ...

ASP.NET ObjectDataSource - reference static properties for parameter names

I use a lot of ObjectDataSources (ods) in my website projects. Almost all of my ods's use SessionParameters; typing the session parameter name into the SessionField property of the ods is annoying and prone to typos. I have a static SessionParams class where I store all the session parameter names, is it possible to reference the membe...

C# console program - stop STDIN from going to STDOUT

I'm writing a simple console app in C#, .NET 2.0. It starts new threads using a threading timer, while it interprets commands on the main thread. I currently take three commands: P - Pause C - Continue Q - Quit This functionality works quite well, but unfortunately when I type P, C, or Q (or any other character for that matter), the c...

Best free richtextbox for ASP.NET 2.0?

What is the best rich text box to use with ASP.NET 2.0? I need to allow users (non technical) format their own email with simply styling, but it needs to be shown as they type, rather than a markup language with a preview. ...

Simplest way to process a list of items in a multi-threaded manner

I've got a piece of code that opens a data reader and for each record (which contains a url) downloads & processes that page. What's the simplest way to make it multi-threaded so that, let's say, there are 10 slots which can be used to download and process pages in simultaneousy, and as slots become available next rows are being read et...

Performance of .Net 2.0 vs .Net 3.5

Microsoft claims that the .Net 3.5 framework has many speed improvements over 2.0. Is anyone able to verify this claim? I am especially interested in computational type stuff (math, graphics, etc), but also more generally? ...

Webrequest Disallow AutoRedirect

Hi In .Net 2.0 how can I disallow AutoRedirect when using WebRequest? I found some source code were there where used an AllowAutoRedirect property, but on my WebRequest there is no such property. ...

Assigning a value (or any other parameter) to asp:checkbox

i'm pretty sure it's not possible, but i'll throw this out there anyways. I have about 10 asp:checkbox controls on the page, and I need to go and update the database every time any of them gets checked/unchecked. Right now i have all of them tied to one event handler that fires on CheckedChanged, then i cast the sender to Checkbox a...

Javascript confirmation dialog - ASP.NET

I saw a couple of similar questions on the same topic, but none of them addressed my issue. I've got a asp.net website, and want to show a status message (asp:label that will disappear in 5 seconds) to the user after the database was updated. i want to assign the text to the label, and then hide it with javascript. i got the js part ...