I'm maintaining an in-house ORM written in C#, and it currently does not have any eager-loading mechanism. To improve performance, we decided that it would require eager loading so we need to write our own code to support that.
(My colleagues and I do not have any experience with any ORM tools, and furthermore, due to some legacy reasons...
How do I detect whether the machine is joined to an Active Directory domain (versus in Workgroup mode)?
...
Say I need to design an in-memory service because of a very high load read/write system. I want to dump the results of the objects every 2 minutes. How would I access the in-memory objects/data from within a web application?
(I was thinking a Windows service would be running in the background handling the in-memory service etc.)
I want...
I have a project consisting of a windows client (approx. 150 users), a webservice and some windows services. All together working in an intranet and build using C# .NET 3.5. Now I want to log exceptions in a central database and manage them (watch top 10, ticket system, etc.) via a web application.
I thought about using and expanding EL...
For a reference type, the object's memory layout is
| Type Object pointer|
| Sync Block |
| Instance fields...|
For a value type, the object layout seems to be
| Instance fields...|
For a reference type, GetType means find the object from the 'Type Object pointer'. All objects of a given reference type object point to the...
Hello all,
Are there any memory leaks when I throw exception from contructor like this:
class Wictim
{
public string var1 = "asldslkjdlsakjdlksajdlksadlksajdlj";
public Wictim()
{
//throw new Exception("oops!");
}
}
Will the failing objects be collected by garbage collector.
...
Ordinarily I wouldn't just post an error message on SO, but after a Google search only found one hit, I thought I'd at least open the floor for this error here on SO.
I have a custom control called Sparkline with a dependency property called Values of type unit[]. Here's an example where I use it in a DataTemplate:
<DataTemplate DataT...
I want to monitor the windows system tray for icon text changes.
How can I do this in .Net preferably in C#?
...
I'm trying to speed up performance of some image scaling & coloring routines in a mobile app based on .Net compact framework 2.0. I've discovered the Bitmap.LockBits method, but how can I get a Bitmap's PixelFormat when the PixelFormat property is not supported in the compact framework?
...
I'm using VB.Net in an ASP.Net 2.0 app to run some regular expressions that remove some unnecessary markup. One of the things that I'd like to do is remove span elements that don't have any attributes in them:
output = Regex.Replace(output, "<span\s*>(?<Text>.*?)</span>" & styleRegex, "${Text}", RegexOptions.Compiled Or RegexOptions.Cul...
Hey, I want to store application configuration data. Currently, I'm using INIs but they are too old and now I want to try something new. I'm on .NET platform using C#.
What solutions do I have? app.configs?
The scenario here is like that, I want to let other programs read the configuration data.
...
Hi I'm trying to create a converter to Convert my images in a database ,datatype"Varbinary(Max)"
to populate my DataGrid in WPF but i have 2 error i show you the Converter:
public class BinaryToImageConverter : IValueConverter
{
public object Convert(object value, System.Type targetType, object parameter,
System.Globalization.Cultur...
This is related conceptually to my question here. However, I've been playing around with NHibernate, and realized what the real core of my question is.
In classic OO design, to properly encapsulate data, it's a common pattern to have values passed in to an object's constructor that are stored in data members (fields). Those values whic...
I'm looking at a web application with a Response.Redirect between two Https pages. I would assume normally that the query string parameters aren't visible for https requests because of the secure connection. However, since the Response.Redirect sends back the 302 - Object Moved response in between the two pages along with query string va...
I need to handle WPF application right before it goes Minimize, not when it's already there.
I found on Window object StateChanged, but it fires when Window object is already in Minimize state, then it's too late.
So, I need something like "StateChanging" event to handle, while Window object is still in previous state.
Is it possible t...
There are several ways that developers can get caught out by unintentional resource leaks in .NET. I thought it would be useful to gather them in one place.
Please add yours with one answer per item, so the best get voted up :)
...
How can I overload a method that takes a Generic List with different types as a parameter?
For example:
I have a two methods like so:
private static List<allocations> GetAllocationList(List<PAllocation> allocations)
{
...
}
private static List<allocations> GetAllocationList(List<NPAllocation> allocations)
{
...
}
Is there a...
Hi
Can anyone tell me how to calculate the diff between two dates without using .net datetime and timestamp classes?
Thanks
...
I am trying to use reflection to determine which methods a derived class overrides from a base class. It is fairly easy to determine if the method is not overridden, but trying to determine if a method is overridden in a base class, or simply created as virtual in the derived class is what I am trying to accomplish.
So, if Class A has ...
Hello, I am writing a WinForms application in C#.
At one point in the application, I spawn a new STA thread (create thread, then SetApartmentState) that creates a new form and then shows it with plain old Show(). The form itself contains only a docked DataGrid whose DataSource points to a DataTable retrieved from a newly open SqlConnect...