.net

Assigning an array of structure to another array of same structure

In Vb.net I am trying to assign an array of structure to another array of same structure Dim info() As assemblyInfo Dim info2() As assemblyInfo Structure assemblyInfo Dim Name As String Dim ClassTpys() As ClassTyp End Structure Private Sub test() info2 = info any change in ifo gets reflected in info2, th...

SQL: Expand 1 Column into 3 on Summarize Table

I'm writing a program that displays products and the stores at which they can be located. So far, I've been able to write an SQL query that displays data as follows: Product Availability Milk Store1 Candy Store1 Eggs Store1 Milk Store2 Eggs Store2 Candy Store3 Eggs Store3 Is there any SQL qu...

SqlException conversion to a custom Exception handler

I have an existing application which uses MS SQL stored procedures to enforce some business rules. When an error is detected it is raised as an exception using RAISERROR back to my .Net application. The .Net application can then use Try/Catch blocks to catch and exceptions and perform and business logic. The problem is that there are ...

.NET WebTest - Get Response Bytes for ValidationRule

I need to create a ValidationRule to test response bytes including responses for dependent requests. It is easy task to get response bytes for main requests, but I can not access responses for dependent requests. I have no idea how to do that. public class WebTest1Coded : WebTest { public WebTest1Coded() { this.PreAuthe...

Is there a Binary Search Tree implementation in .NET 4?

I'm looking for a built-in Binary Search Tree implementation in .NET 4. Is there one? ...

Unit testing for an event using Reactive Extensions

I'm using Reactive Extensions for .NET (Rx) to expose events as IObservable<T>. I want to create an unit test where I assert that a particular event is fired. Here is a simplified version of the class I want to test: public sealed class ClassUnderTest : IDisposable { Subject<Unit> subject = new Subject<Unit>(); public IObservable<...

get 'ldftn' function pointer in C#

in cil code, ldftn is used to get the function pointer address to call the delegate constructor(i.e. .ctor(object, native int)). How to get the function pointer used to construct delegate in C#? ...

Any tools for detecting all the .NET dll's referenced

I use Antlr tools as follows (on Mono) dmcs /r:Antlr3.Runtime.dll /r:StringTemplate.dll *.cs /out:Main.exe I reference two dll's, but there is another dll file (antlr.runtime.dll) that is referenced behind the scene. I got this when I have an error just copying two dlls and compile. Are there any .NET tools to detect what dll's are...

dropdown selected value

Hi All I have a little problem. How can I select value with value id? this is my code: string actionId = new MyRptSubReportEntity().GetReportAction(this.SubReportId).ToString(); if (actionId == "0") actionId = "4"; // this.drpActionList.SelectedIndex =int.Parse(actionId); this.drpActionList.SelectedValue = actionId; but it is not ...

Performance Improvement using multiple instances of an application

I am having a performance sensitive .net application. It is capable of doing parallel threading upto 32 threads. We have need of improving it even further. Increasing the thread may not really help since the number of failure attempts to process increases as we increase the number of threads. My question here is, What are the options...

How to initialise a class at program startup?

Hello.. I have this class class Statistics { Dictionary<decimal, Statistic> BabyDataStandardAgeHeadCircumference; Dictionary<decimal, Statistic> BabyDataStandardAgeLength; Dictionary<decimal, Statistic> BabyDataStandardAgeWeight; Dictionary<decimal, Statistic> BabyDataStandardWeightForLength; } These data are fixed ...

How do I setup Lucene so that I can search ignoring whitespace characters?

For example, a list of part numbers includes: JRB-1000 JRB 1000 JRB1000 JRB100-0 -JRB1000 If a user searches on 'JRB1000', or 'JRB 1000' I would like to return a match for all the part numbers above. ...

ASP.NET Web Service - How to change Target Location

I have a webservice that works locally but when I publish it to our web server the auto-generated WSDL uses the server's name rather than the host name. I have searched the internet but only found complex answers. There should be a simple web.config change or class attribute setting to change the target location. Basically the aut...

How to automatically size TabControl in a DockPanel - WPF

I have a simple WPF Forms app. I have a DockPanel as my root panel. The first child is a StackPanel that has some controls in it, then the second control is a TabControl. What I want, and the panel types can change all they want is for the TabControl to maintain the fill size of the window except for what the first StackPanel consumes...

What domain should I give this cookie?

I'm trying to call a web service from a c# application, with sessionID. In order to do this I need to set the "Domain" header in a cookie. In Fiddler it looks like - "ASP.NET_SessionId=izdtd4tbzczsa3nlt5ujrbf5" (no domain is specified in the cookie). The web service is at - "http://[some ip goes here]:8989/MyAPI.asmx". I've trie...

Code First CTP: Multiple PKs or FKs

Hello, In some instances, we may have PK/FK references duplicated, so entity A and entity B are in a PK/FK relationship, but 3 times. So entity A would have 3 FK collections and entity B would have 3 entity references. How does that work with the code-first template? Do you follow the naming convention of Entity Framework model/datab...

Why is creating an appdomain so expensive?

What are the exact reasons that the creation of an appdomain is so expensive. They share the same heap, the same assemblies etc. What exactly needs to be done by the CLR that comsumes so much resources? We have seen scenarios where accessing a type/instance from the other appdomain takes up 10 seconds (update: all required assemblies th...

Visual Studio 2010 designer error

Hi, I'm having a problem with some custom forms I developed. This form worked perfectly with VS2008, but is causing an error with VS2010. Going back to VS2008 is a worst case scenario option for various reasons. Anyway the problem - When I try to view a form of type FormWithError in design mode I get the standard "To prevent possible...

Reading a datetime column with a null data SqlCeDataReader ?

What's the way to read a column that might have a null datetime value in SQLCe? Right now i have this SqlCeDataReader reader = cmd.ExecuteReader(); DateTime? shapeFileSQLDateTime = (DateTime?)reader["ShapeFileTimestamp"];//ok b/c has data DateTime? mdbSQLDateTime = (DateTime?)reader["CreatedTimestamp"]; //throws exception b/c is nul...

How Do I Delete a DNS Domain Programmatically?

I am building a C# web app to manage our DNS servers and am using the WMI Namespace for everything. The only thing I am having trouble with is deleting DNS Domains. Here is my code: internal static bool DeleteDomainFromDns(string DnsServerName, string ContainerName, string Name) { try { string Query = "SE...