I fill the DGV by looping through a dataset and adding a DGV row for each datarow. After this the DGV.RowCount = DataSet.Rows.Count. Funny thing is that the DGV shows only a part of it (19 of 2448 in my example). After some testing I figured out that the rows show up if I change the Window size a bit.
So now I use a work-around by inclu...
I want to know if I can tell what appdomain a object was created in. This is for a unit test but also useful general knowledge. I have the following pieces of code (this is example code for illustration).
public Foo Create()
{
AppDomainSetup appDomainSetup =
new AppDomainSet { ApplicationBase = @"z:\SomePath" }
AppDoma...
How do I log inner exception with Log4NET?
This is my current conversion pattern:
<conversionPattern value="%date [%appdomain] %-5level %logger [%property{NDC}] - %message%newline" />
...
Given the path of a file (e.g. "C:\MyPicture.jpg"), how do I convert a binary file into a byte array?
I know I have a lot of .NET objects at my disposal, such as BinaryReader, FileStream, StreamReader, and others, but I'm not sure of the best method to take a binary file and convert it into byte[]. How might this be accomplished?
...
I've been unable to find any info on this, which seems like it could be the only way to solve a past unanswered question of mine on SO. However, I think this should really be a separate question now.
I am wondering if there is a way to dynamically redefine an ICommand-derived class's CanExecute method. I'm still new to .NET and perhap...
Hi,
How can I have a trace of native code generated by the JIT-Compiler ?
Thanks
...
Hi,
When a MarshalByRef object is passed from an AppDomain (1) to another (2), if you wait 6 mins before calling a method on it in the second AppDomain (2) you will get a RemotingException :
System.Runtime.Remoting.RemotingException:
Object [...] has been disconnected or
does not exist at the server.
Some documentation about t...
I have several medium-sized data sets in-memory that I need to be able to filter and find information from quickly. The data sets are small enough that I don't want to take the performance hit of going to a database every time I need an entry but large enough that I really need to index the data somehow.
Currently, I'm using POCO object...
Is it possible to change the ConnectionString value in a app.config at runtime? According to the MSDN documentation it should be possible as the ConnectionString property "Gets or sets the connection string."
My code looks like this:
ConnectionStringSettings mainConnection = ConfigurationManager.ConnectionStrings["mainConnection"];
mai...
I'm looking for sample .NET code (System.Drawing.Image) that does the following:
Load a given image file.
Generate a new single image that repeats the orginal image for x times horizontally.
...
Hi,
I have a C# exe that needs to be run using WMI and access a network share. However, when I access the share I get an UnauthorizedAccessException. If I run the exe directly the share is accessible. I am using the same user account in both cases.
There are two parts to my application, a GUI client that runs on a local PC and a backen...
Does anyone know if Microsoft plans on implementing XAML (declarative) databinding of IronRuby objects for Silverlight and WPF? Without it, using IronRuby for Silverlight/WPF development really isn't all that compelling (IMO).
...
Is possilbe to open up a link from a windows form app like so:
System.Diagnostics.Process.Start('http://www.Stackoverflow.com');
But have the link open in the current ie7 or ie8 that is already open? Currently we have an that loads a page when the user loads some info. We need it to load the same tab.
...
Hi
I am using string template to render some content, but the content may be variable so not sure how to pass it in (using .net / c#)
Basic idea is I have a List> which need to end up as parameters, e.g.
List<KeyValuePair<string, object>> ret = new List<KeyValuePair<string, object>>();
ret.Add(new KeyValuePair<string, object>("elem1",...
I'm trying to map a table, where one of the column is a binary array (which is a Java UUID), to a C# class.
I would like to read the byte array and return a string representation of the UUID. Just wondering what's a good place to start.
...
This is very odd.
We have some managed C++ (an assembly) which uses a .NET COM interop dll generated by TlbImp to make calls into a COM object. When we register the COM DLL we specify that we want it to execute within a surrogate (the "DLLSurrogate" registry entry).
Our COM DLL is 64-bit and is executing on a 64-bit platform.
When we ...
I've successfully built and tested a vb.net app in VS 2008 that uses a dll (abcTest.dll) built by another developer. However, when I deploy the application to another machine (Release directory contents), I get "System.DllNotFoundException" when I run the executable. The dll is in the same directory as the executable, etc. The solutio...
Hi,
I'm installing a product developped in ASP .NET 3.5 SP1
I made a setup using ASP .NET Web Deployment Project. The Setup runs without any problems on one server, and fails on a freshly installed one.
The .NET 3.5 SP1 framework is installed on a fresh W2k8 Server.
Anyone knows what I should install to get the Setup running?
...
I am trying to use the VBCodeProvider to dynamically compile an assembly. The problem I'm running in to is that I need to give the CompilerParameters class a list of referenced assemblies.
The code being used is this:
CompilerParameters parameters = new CompilerParameters();
parameters.ReferencedAssemblies.AddRange(AppDomain.CurrentDom...
I have a aspx page, in that page i have an Iframe. In the Iframe i do some stuff in code behind and when it is done I would like to do a postback from the aspx.
In other words, Is it possible to do a postback programatically from the code behind of the iframe to the parent page?
I think a postback can be done using "ClientScript.GetPo...