January 16th, 2009 02:52 PM
VS2008, C#
In several of my business objects, I'm lazily loading some data that requires a call to the DB. This presents a problem when trying to quick watch the parent object. When it hits that...
April 30th, 2008 09:20 AM
Heya. :)
I've got a quirky thing happening with databinding in C#, .NET 2.0, CSLA 2.something, and my databinding.
The user hits a button, i popup a modal, populate some comboboxes on the...
April 25th, 2008 02:35 PM
You may want to explicitly tell your SqlCommand object that the CommandType is a StoredProcedure:
nonqueryCommand.CommandType = CommandType.StoredProcedure;
I'm not sure what the default is...
April 24th, 2008 02:06 PM
Self reply inc!
http://weblogs.asp.net/grobinson/archive/2003/09/11/27127.aspx
Seems this individual has the same problem and essentially the same workaround.
One of the comments:
April 24th, 2008 01:49 PM
So I'm playing with a screen in our system. On the screen are a few comboboxes that we have databound to a list of stuff from a cache. Dictionary type stuff that we don't have to go to the database...
April 23rd, 2008 10:49 AM
Replace the catch bit of my example with this:
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
This is also permissable:
April 23rd, 2008 09:14 AM
April 23rd, 2008 07:30 AM
try
{
if (x < 0)
throw new Exception("Parameter out of bounds.");
}
catch
{
Console.WriteLine("");
}
April 22nd, 2008 03:16 PM
Your signature doesn't display for me.
April 22nd, 2008 09:09 AM
Quick google search revealed this:
int i = 100;
string str = Convert.ToString(i, base); //base = 2, 8,10 or 16
You'll obviously want to use base 2 for binary.
April 21st, 2008 07:20 AM
In order to maximize the window of the .exe, you'd somehow have to match up the Process with the window handle. Unfortunately I'm not sure how to do this. :(
April 21st, 2008 07:19 AM
Are you trying to figure out what hash function the Hashtable uses? It's probably object.GetHashCode().
April 21st, 2008 07:17 AM
Perhaps you have to specify the owner of the modal?
April 21st, 2008 07:16 AM
Your other options include inheriting from System.Drawing.Image. Bitmap actually inherits from Image, anyway.
Or you could use what's called extension methods.
...
April 18th, 2008 07:05 AM
Yep, set the width of the ColumnHeader objects to -2. For instance:
foreach (ColumnHeader ch in lvList.Columns)
{
ch.Width = -2;
}
Try it!
April 17th, 2008 08:11 AM
Beaten by nelo by mere minutes!
April 17th, 2008 08:10 AM
You're going to want to take a look at the System.Diagnostics.Process class. Inside of it it has a StartInfo class that you can fill in with executable location data.
Process batFile = new...
April 17th, 2008 07:24 AM
Yup, nested classes are instantiated the exact same way as all the others. For instance:
public class Class1
{
public class NestedClass1
{
}
}
April 16th, 2008 03:29 PM
@zdavis - I don't see any nested classes in your example. Maybe a misplaced bracket?
@JustSomeGuy - What I'd suggest here is to just try it out. Nested classes in C# are very useful for limiting...
April 16th, 2008 10:02 AM
You may want to provide a link to the example you're referring to. We don't know if you're talking about ASP or WinForms. I dunno if it'd matter much, but more context never hurts.
April 15th, 2008 01:12 PM
Yep, the simplest way being using a BackgroundWorker. Very easy to use for simple threading. Just remember to wrap any UI changes in the following:
...