Is there a collection (apart from Dictionary) in the .NET framework (3.5) that throws an exception when a duplicate is added?
HashSet does not throw an exception here:
HashSet<string> strings = new HashSet<string>();
strings.Add("apple");
strings.Add("apple");
Whereas the Dictionary does:
Dictionary<string, string> dict = new Dictio...
Currently I am working on Test Automation in which we are trying to test our server by randomizing server calls through 1...n number of users. for the purpose we are logging activities, errors and informations in a log file using Log4Net tool.
Now i need to know if there is any control (preferablly free control) that works like bairtai...
Simple yes/no question : Can I call a vb.net function compiled in a vb.net dll from a c# function compiled in its own C# dll? Running in the same application.
...
Hi!
I would like to have a ToolStripSplitButton that invokes it's last invoked DropDownItemClick in Click event.
If You've used Abby FineReader then You know what I meam.
I know I can link everything in a form class but I would like to have a deriver class that does it out of the box.
I could do it easyly if public ToolStripItemColle...
I use DataGridView control to manage a simple dictionary (several columns and a few hundred rows). DataGridView functionality is almost sufficient. I can add new rows, modify values and copy data from it to Excel. One thing I cannot do is to copy data from Excel to my control. Is it possible with some properties? Or is some code required...
While answering a question on SO yesterday, I noticed that if an object is initialized using an Object Initializer, the compiler creates an extra local variable.
Consider the following C# 3.0 code, compiled in release mode in VS2008:
public class Class1
{
public string Foo { get; set; }
}
public class Class2
{
public string Fo...
In my master a partial _styles is loaded.
In this _styles there is a ^var styles = ""
Now in all my views or partials I can say var styles = styles+"another style"
Normally a style is defined as
%link{ href="../../content/css/partial.css" rel="stylesheet" type="text/css" }
How can I append the output of the %link directive to the st...
Hi,
i currently have the problem that i don't know how to make a LINQ select to grab ALL Productpricediscounts from a category:
public class ProductCategory
{
public List<Product> categoryProducts;
}
public class Product
{
public List<Productprice> productPrices;
}
public class Productprice
{
public List<Productpricedisco...
Hey All,
I want a help. I have a window form application. Whenever I click on the "close" of the form, the application should itself close.
Can anyone help me.
Regards,
Justin Samuel.
...
To cut to the chase, can the TeamCity .NET NUnitLauncher process Microsoft csproj files?
I ask this question because of the following.
I have a NANT build script. In this script I have a number of tests which use nunit-console.exe (which ships with NUnit v2.5.2).
An example of a test in my Nant build file is:
<target name="x.Commons....
Hello all
I have an XML file that is loaded into an XElement. I want to count the number of PollEvent children that both exist and that satisfy some conditions. I have got the code working to count the number of PollEvents in total but when I come to filter this list I do not seem to be able to call .Where, I believe this to is due to...
Possible Duplicate:
Assuming 32bit ints
So I read somewhere that int equals int32 in c#.
Is it true also on 64-bit machines?
Should I use int32 just to make sure no one at microsoft decides to change the size of int?
...
hi
I am new in .net technology.
I have some knowledge about webservices and how to add webrefferences in the project.
In my project there is a same web servises will run on more than two server.
All web services are same just their servers are diffenrent.
So is there a way to add web services dynamically? and i can call web services fr...
Using RequestAdditionalTime for a windows service, does not prolong the waiting period long enough.
I have to wait for a job to finish , so i keep on
while (gs_bisProcessing)
{
OnRequestMoreTime(20000);
Thread.Sleep(20000);
}
but still the job takes long enough that ...
I have seen way to many places where a method takes a long or an int to represent durations in either nanoseconds, milliseconds (most common), seconds and even days. This is a good place to look for errors, too.
The problem is also quite complex once you realize that you can mean for the duration to be a certain number of seconds, or an...
If I have a decimal like 32.593170731707329023999999999 - what SQL Datatype, and precision and scale should I use?
My integer parts are pretty small (1-10000) and fraction part big.
Have tried decimal with different variations of precision and scale, but get an overflow exception in .Net.
...
I am looking at moving from NUnit to MbUnit for my unit testing framework as it has a couple of features that I like, one of them being the parallelizable attribute. If I mark tests with this attribute what happens
i, are all instance variables available only to their own thread or are they shared?
ii, how many tests will execute at on...
I've got a WCF DataContract that looks like the following:
namespace MyCompanyName.Services.Wcf
{
[DataContract(Namespace = "http://mycompanyname/services/wcf")]
[Serializable]
public class DataContractBase
{
[DataMember]
public DateTime EditDate { get; set; }
// code omitted for brevity...
}
}
When I add a refe...
Hi,
Will the compiler optimize pretty formatted strings, or will that code run slower than strings that are not divided in a readable way?
for example
string sql =
"select * " +
"from person " +
"where id = :id";
or
string sql = "select * from person where id = :id";
This is just a small example. You know how complicate...
I'm looking for a solution that gives me a central hub from which to view and manage errors that occur in my system, regardless of the tier in which they occur. I already have logging (log4net), perf counters, etc. But what I'm wondering is what tools I can use to collate this information into a central place. I am interested in both com...