When I first started programming in .NET I used try/catches all the time. I am finding lately though I rarely ever use them for web applications. My exception (no pun intentended) is unmanaged code that could potentially create a memory leak such as com objects. Are they really needed anymore or do they just clutter things up?
UPDATE: ...
Can someone explain dependency injection with a basic .NET example and provide a few links to .NET resources to extend on the subject?
This is not a duplicate of http://stackoverflow.com/questions/130794/what-is-dependency-injection because I am asking about specific .NET examples and resources.
...
How can we implement Windows Forms Designer in a WinForms application ? Visual Studio uses System.ComponentModel.Design namespace to implement the Form Designer. How can we use this to implement a Form Designer in a WinForms application ? Is there any other library available for achieving the same ?
...
I'm working with legacy code here and there are many instances of SQLDataReader that are never closed or disposed. The connection is closed but, I am not sure if it is necessary to manage the reader manually.
Could this cause a slowdown in performance?
...
Consider this:
Requisite:
//The alphabet from a-z
List<char> letterRange = Enumerable.Range('a', 'z' - 'a' + 1)
.Select(i => (Char)i).ToList(); //97 - 122 + 1 = 26 letters/iterations
Standard foreach:
foreach (var range in letterRange)
{
Console.Write(range + ",");
}
Console.Write("\n");
Inbuilt foreach:
letterRange.ForEach(r...
I want to give my users the option to use a textbox and press Enter. The challenge is that I have 5 textbox, and 2 options. 3 textbox belong to one button, and 2 textbox to the other. How do I trigger a particular Button according to the textbox the user was in when he press Enter?
...
I would like to find what people got the most out of using WPF, in particular:
The best and stunning UI examples out there
Dark corners that no other UI can implement with ease and style (say MFC or GTK)
Professional examples with code
Suggestions?
Probably the best book on the subject is WPF in Action with Visual Studio 2008
...
I am developing a log parsing service that captures specific security events in the Windows Event Log. My initial thought was to use Microsoft's LogParser, but I am not looking for any functionality beyond selecting specific Instance/Event IDs already known in advance.
After some benchmarking, I found that iterating over the entire .NE...
I am trying to bind an ASP.NET hyperlink to the "Handle" column of my dataset like this:
<ItemTemplate>
<asp:HyperLink ID="idTracking" runat="server" NavigateUrl='<%# "javascript:SendPath(" + Eval( "Handle", "{0}") + ")" %>' Text="Test" />
</ItemTemplate>
I would like the NavigateUrl to...
Hi,
How can I use this sample Inheritance and Associations with Entity Framework but using a data type GUID as Condition?
In this sample, I only use Strings and Integers as Condition.
Thanks
...
I want extension of the following code for selected value in edit view.
take a case of country -> state -> city.
i have script CascadingDropDownList.js:
function bindDropDownList(e, targetDropDownList)
{
var key = this.value;
var allOptions = targetDropDownList.allOptions;
var option;
var newOption;
targetDropDownL...
We have multiple projects in our system that want to share the same asmx webservice. Does anybody have any advice / best practices on how to do this.
The problem is that the webservices are constantly changing so i can't just add a webreference to production. Also that is dangerous because when doing development I want it pointing t...
I have been tasked to create a control that has hot spots that will allow drag and drop of images. These locations will change based on what is being dragged onto the control. After dropping the image on the control it will need the ability to move to a new location (either by drag and drop or using the arrow keys).
The closest example ...
I working with some EBCDIC data that I need to parse and find some Hex values. The problem that I'm having is that it appears that I'm reading the file in with the incorrect encoding. I can see that my record begins with "!" (which is a x5A in EBCDIC) but when doing the conversion to hex it returns as a x21, which is the ASCII value for ...
I've written a helper class that takes a string in the constructor and provides a lot of Get properties to return various aspects of the string. Currently the only way to set the line is through the constructor and once it is set it cannot be changed. Since this class only has one internal variable (the string) I was wondering if I shoul...
Should be an easy question, so don't all pile on -
I'm trying to override WndProc like this:
using System;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
snip...
public class GTextBox : ...
I'm using the .NET 3.0 class System.Security.Cryptography.MACTripleDES class to generate a MAC value. Unfortunately, I am working with a hardware device that uses "1111111111111111" (as hex) as a single-length DES key. The System.Security.Cryptography library does some sanity checking on the key and returns a Exception if you try to us...
I am making multiple sub folders in my App_Code folder to organize my classes and it seems it is working fine, is there any restriction on that?
like:
App_Code
Ui
TextBoxes
Labels
...
This morning, I read a very good question about what the person should expect from a Sharepoint position. I have a similar question about server side engineering. What can I expect from server side engineering positions, and how is it similar and different from desktop development?
I have experience with WinForms, WPF, some light mu...
Is there a simple way to have a code library automatically detect if it's being called from a console application or a windows application? I'd like my library not to report to the Windows Event log if it's being called from a console window, but instead report to the console window. If however, it's not being run from within a console...