I've got a huge XML file that's being deserialized by XmlSerializer in an XSD-generated class structure. Everything used to work just fine, but now a weird thing started happening. Sometimes (50% of runs) a field of a certain object of a class that's deep in the class tree just changes to a certain value of the same field of a different ...
How can i find the current install version of directx on my system using code(C#).
...
Is it possible to cut decimal, and not round it. Like this.
decimal number = 12.159m;
How can I easily get 12.15 from number and not 12.16?
Is there an easy way or is the string manipulation the only way?
...
Can anyone explain to me how to verify mocks if you don't have their Moq-wrapper? MockFactory.Verify() won't do. I want to be able to verify the mocks explicitly and mocks should be created using mockfactory! Please send in your comments.
...
Hi,
I have a application that uses LocalDataCache to synchronise a SQL Server 2008 Express database to a client database (.sdf file). This works great and I am now managing the conflicts.
I am using this Microsoft resource as a guide: How to: Handle Data Conflicts and Errors
The conflict I am particularly interested in is ConflictT...
What good resources are out there for learning Design patterns in C# and the .NET Framework?
...
I am trying to download a client's data to my local machine (programatically) and their webserver is very, very slow which is causing a timeout in my WebClient object.
Here is my code:
WebClient webClient = new WebClient();
webClient.Encoding = Encoding.UTF8;
webClient.DownloadFile(downloadUrl, downloadFile);
Is there a way to set a...
Using VB.NET
How to get Datagridview cell value.
I want to insert a Datagridcell value in the table, How to get datagridview cell value.
Need vb.net code Help
...
Hi all, is it possible inject static property, like I do below, because it does not work for me?
public static IMerchantModule MerchantModule { get; set; }
public RequestBaseValidationRules()
{
MerchantModule = ObjectFactory.GetInstance<IMerchantModule>();
}
It works when I inject to non static property.
Any ...
I've been playing around with Unity to do some AOP stuff, setting up via IOC like:
ioc.RegisterType<ICustomerService, CustomerService>()
.Configure<Interception>().SetInterceptorFor<ICustomerService>(new InterfaceInterceptor());
... and then having an ICallHandler on the ICustomerService interface's methods. For teh time being i w...
I am developing a WPF application, and have a TextBlock which I want to use command binding to trigger a command on when clicked. What's the best way to achieve this?
The TextBlock-control does not have a Command property, but it does have a CommandManager. What is this? Can it be used for command bindings? I've seen many other contro...
Today I noticed that in my ConfigurationManager.ConnectionStrings the very first instance is .\SQLEXPRESS. I remembered explicitly removing this entry from my web.config so I checked again, but didn't find a thing. Then I did a search over my entire solution, not a single match.
Where the hell is this connection string coming from and ho...
In other words, if I have:
var ll = new LinkLabel();
ll.Text = "Some links go here.";
ll.Links.Add(0, 4); // Some
ll.Links.Add(11, 2); // go
Is there any method I can call to replace the text of the "Some" link with something else while keeping the "go" link the same.
I only want to know if there is a built-in method. This is not h...
I am in the process of porting some .net remoting code to WCF.
Can I safely assume that all classes that are Serializable and works as .remoting method parameters will work with WCF using the binary message encode?
If not is there a “rule of thumb” that I can use to estimate what problems I will hit?
...
Hi,
Please excuse my choice of wording and/or mixup of terms, I am a dummy when it comes to socket programming. I am trying to connect to a TCP server, write a message and process a response. I use the following code:
Dim tcpClient As Sockets.TcpClient = New TcpClient()
tcpClient.Connect(hostname, 9080)
Dim networkStream As NetworkSt...
OK, this must be a duplicate question, but I cannot find the answer:
I have a listbox that is databound to a Collection. By default Items[0] is selected. How can I prevent this in order to ensure that the SelectionChanged event is raised any time I click a ListBoxItem?
EDIT:
I had already dismissed the SelectedIndex=-1 route, but I trie...
I have written a custom remoting formatter sink for an established application. The formatter appears to work for most cases until I try to use it to call a remote method to which I pass a call-back to a CAO. At this point I get a SerializationException indicating that I am trying to serialise the CAO, which is obviously not what I want ...
I have a seemingly very simple case where I'm using System.Threading.ReaderWriterLockSlim in the 3.5 version of the .NET Framework. I first declare one, as shown here:
I put a break point right before the lock is acquired and took a screen shot so you can see (in the watch window) that there are currently no locks held:
Then, ...
Sometimes it is not possible to find if user is using Anonymous proxy. So i came up with some ideas:
Get IP of client, do reverse check and check if it returns a hostname and also get number of any websites hosted on same ip then it could be a proxy connection assuming it is website hosting provider ip.
Store ips of hosting providers w...
EDIT: followup at http://stackoverflow.com/questions/1791377/netusermodalsget-returns-strings-incorrectly-for-c-net
I'm struggling with the DLL declarations for this function:
NET_API_STATUS NetUserModalsGet(
__in LPCWSTR servername,
__in DWORD level,
__out LPBYTE *bufptr
);
(Reference: http://msdn.microsoft.com/en-us/libr...