.net

problems with large DLL?

Are there any problems associated with using and deploying large DLLs? I'm using a couple of DLLs that's 30Mb and 17Mb in size. ...

Associating Additional Information with .NET Enum

My question is best illustrated with an example. Suppose I have the enum: public enum ArrowDirection { North, South, East, West } I want to associate the unit vector corresponding to each direction with that direction. For example I want something that will return (0, 1) for North, (-1, 0) for West, etc. I know in J...

Silverlight with C++.Net

Hi, Can you use C++.Net for writting a Silverlight application? Not use C# or VB.Net as the backend language but C++.Net ...

From FullyName string to Type object

Anyone know how to get a Type object from a FullName? Eg. string fullName = typeof(string).FullName; Type stringType = <INSERT CODE HERE> Assert.AreEqual(stringType, typeof(string) ...

How can I specify a different path to unzip for file unzip?

I am trying to unzip a .zip file from source to destination. It is taking the default source as: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE The source is actually in my project. Code: FastZip fz = new FastZip(); fz.ExtractZip("Emp2.zip", Server.MapPath("~/Response Attachments/"), ""); ...

Configuration for SQL Server Based Assembly

I have an assembly deployed to SQL Server that performs an export to an accounting system SDK. The reasons that this is deployed to SQL Server are beyond my control, and I cannot modify the target database. In development, I moved several dynamic queries from hard-coding to text files outside the application, so that queries can be twe...

Best way of sorting a list of strings based on difference from a target string?

I need to sort a List based on the difference between the strings in the list and a target string. What's the best way of implementing this kind of sorting algorithm? I don't care too much about performance but the collection could potentially become big (let's say half a million tops). Any Help Appreciated! ...

Remove .net ContextMenuStrip Padding

Hi, When creating a ContextMenuStrip, there is a huge amount of padding around the contained controls. For example: Me.myMenu = New ContextMenuStrip 'unset all obvious padding settings' Me.myMenu.ShowCheckMargin = False Me.myMenu.ShowImageMargin = False Me.myMenu.Margin = New System.Windows.Forms.Padding(0) Me.m...

Resources/App.config or Database where is the best place to application strings

All, I was currently looking at on old application that I am maintianing and it uses a mixture of retrieving Application config settings from both the App.config and application config table in the DB. In the new software I am working (a port of the old application) I have a list of email addresses that are static and rarely change, w...

Fastest way to create a list of unique strings from within a loop?

I have a set of strings (~80 000) I can only access sequentially by the hits.Doc(int).Get("fieldName") method. List<string> idStrings = new List<string>(); int count = hits.Length(); for (int i = 0; i < count; i++) { string idString = hits.Doc(i).Get("id"); if (!idStrings.Contains(idString)) idStrings.Add(idString); } ...

Weird Select/Delete query generation in Linq2SQL

Hi For some or other reason Linq2SQL generates the following on 1 of my tables for a delete: DELETE FROM [dbo].[Tag] WHERE ([TagId] = @p0) AND ([Type] = @p1) -- @p0: Input UniqueIdentifier (Size = 0; Prec = 0; Scale = 0) [fb538481-562d-45f2-bb33-3296cd7d0b28] -- @p1: Input TinyInt (Size = 1; Prec = 0; Sc...

How do I handle submits using objects from different datacontexts?

I've been running into a problem where using objects from two datacontexts that are of same type, won't submit objects on. To make this matter simple consider the following LINQ-to-SQL design where we have database tables describing cars and persons. +--------------+ +--------+ | Car | 1 1 | Person | +--------------...

What is the best way to determine if a System.DateTime is midnight?

It seems that there are several possible ways to determine if a given System.DateTime represents midnight. What are the pros and cons of each? Is one more readable or perform better than the others? EDIT: I believe that readability is more important than performance until profiling shows that there is an issue. That is why I asked about...

Data Binding on Custom Class

I'm trying to create a custom class that is based off of an XML file (using xsd.exe). The end goal of this class is to bind it to a UI element (probably a gridview or something like that - I haven't decided yet). Are there any interfaces that I need to be sure to implement in order to do this? I would think IEnumerable would be a key one...

Expression Is a value and therefore cannot be the target of an assignment

I ran into an issue using a struct today that caught me off guard, and I was hoping someone could shed some light on it for me. I have a struct defined like this: public struct PaymentDetail { public Decimal Amount{get;set;} public string CheckNumber{get;set;} public PaymentType PaymentType{get;set;} } I have a class that...

Does an EventWaitHandle have any implicit MemoryBarrier?

New to this website, so let me know if I'm not posting in an accepted manner. I've frequently coded something along the lines of the sample below(with stuff like Dispose ommited for clarity. ). My question is, are the volatiles needed as shown? Or does the ManualResetEvent.Set have an implicit memory barrier as I've read Thread.Start...

How can I create a simple class that is similiar to a datatable, but without the overhead?

I want to create a simple class that is similiar to a datatable, but without the overhead. So loading the object with a sqldatareader, and then return this custom datatable-like object that will give me access to the rows and columns like: myObject[rowID]["columnname"] How would you go about creating such an object? I don't want any...

Use C++ CLI template class in C#

Hi, I have the following class in C++/CLI and an explicit template instantiation for the int primitive.. template<typename T> public ref class Number { T _value; public: static property T MinValue { T get() { return T::MinValue; } } static property T MaxValue { T get(...

Anyone use Recommind, Autonomy or FAST with .NET?

We're evaluating some enterprise search servers and would like to have some developer feedback on the API's of Recommind, Autonomy and/or FAST (now owned by Microsoft). We're a .NET shop so we'd either be using web services (xml) or some kind of API wrappers to hook into the search application. Anyone use any of these products before -...

How to display accurate times for testing performance numbers in C#

Hi, I want to test the speed of an algorithm, what DateTime overload will give me the most precise time? (I still need day/month/year/seconds but then I want milliseconds also). ...