.net

Should I ever use Enums as discriminators?

When do Enumerations break down? To support a new feature in an existing system, I was just considering implementing some form of discriminator to an entity table in my database schema. In wanting to begin by doing the least thing that will work I first of all decided on an integer column and a C# enum at the business entity layer fo...

Can 'Not putting my DB under the 'App_Data' affect the way Linq2Sql works?

Hello, I'm experiencing a problem while working with all my projects. I don't get Intellisense with Linq2Sql and, when I write partial classes in the model folder, properties created by the Linq2Sql designer are not recognized by the partial classes. So, I'm trying to rule out all the possible sources of the problem. I have 2 cases: ...

Looking for .NET library capable of reading HDF4 file format

Does anybody know a simple library to read data from HDF files in .NET framework? ...

Disable WCF headers

Hi there, How an I disable To, Action and all other standard WCF headers leave just body alone? If it's possible how client and service configs should look like? ...

Develop a Family Tree Portal with several functinality

We need to develop a family tree portal which also supports functinality like Portal Framework (Sub portal) Dashboard Blogs, Forums, Events, Polls, Task Member subscription Advertisement Chat Broadcast Document Management Personalization Alerts & Reminders And above all Family tree It is also decided to build family tree from scratc...

.net mvc pass dictionary data from view to controller

A while ago, I was trying to pass a dictionary data from my view to my controller. And I was able to do so after googling on the net(remember it was one of scott hanselman's posts). The solution I had was something like <%for(int index=0; index<Model.Count(); index++){ var property= Model.ElementAt(index);%> <input type="hidde...

Calling IIS AppPool from SQL Server Job (2005)

Hi Folks, I was wondering if it’s possible to make a call to an IIS AppPool from a SQL Server Job (2005). I am basically looking to have a job monitor a table for an event and if a condition is fired I want to call IIS and shutdown a specific AppPool. I presume I can do this thru the CLR and .NET from the SQL Server Job but wondered wa...

Code review: Determining whether a folder exists, given the full file path?

With a function being passed a full path to a file, such as C:\someFolder\anotherFolder\someXML.xml, determine whether the folder exists. Is there a smarter/better/more elegant way of doing this? Here is my implementation: Private Function FolderExists(ByVal fullPath As String) As Boolean Dim folders() As String = fullPath.Split("...

How should a mobile project reference/use classes in the full .net framework?

Our team is developing a framework. In a different solution, we have a mobile project (along with other "normal" .NET projects). That mobile project would benefit from using some of the code in the framework. However, the framework is the full .NET version, not the compact framework. How should the mobile project use that framework code?...

update hashtable by another hashtable ?

How can I update the values of one hashtable by another hashtable, if second hashtable contains new keys then they must be added to 1st else should update the value of 1st hashtable. ...

Object Copy simple question ?

Hi If copying an object just create a new reference to the same object in memory then i don't understand why it is useful, because it only creates another name for the same object. Copy, means for me, creating a clone of the object in another memory location. Then i could manipulate 2 separate objects which are the same only at the mo...

Listing Attached Properties in Silverlight

Anybody know how to list the the attached properties that have been set on a UIElement in Silveright 3? Plenty of WPF solutions as usual! Cheers ...

How to get all controls from a form at runtime in c#?

Is there a simple way to get all controls that contains the property ".Text"? I'm able to get all "top level" controls, but my code doesn't find sub controls like menu items on all levels etc. I also tried "ctrl.HasChildren". Does somebody know how to do this in winforms at runtime? Best regards. ...

DataSourceView.ExecuteUpdate with GridView

I'm defining my own DataSourceControl and DataSourceView. The load and display of collection in the GridView works perfectly, however, when I click Update (after clicking Edit to Edit a row), the values collection which comes through as the second parameter to ExecuteUpdate in my DataSourceView is populated with the old values as is old...

Using SoapFormatter to Serialize Selective Properties of a Class

Hi I need to serialize several fields of my class class Foo { Guid value1; decimal value2; SomeCustomEnum value3; } Can I serialize all fields one by one: MemoryStream ms = new MemoryStream(); SoapFormatter sf = new SoapFormatter(); sf.Serialize(ms,value1; sf.Serialize(ms, value2); ...

What is the .NET equivalent of Java's java.util.concurrent package?

I come from a Java background. I am wanting to learn more about concurrency in .Net and C#. Is there something similar to Java's concurrent utils package? ...

does .net provides api to convert ascii to bcd?

Platfrom 3.5 .net.(c#) please refer me to code which converts ascii to bcd (c#). ...

Looking for a solid client side sockets library

Nothing too fancy, but the following would be nice for .NET: Be able to instantiate the object and hook up the MessageReceived and ConnectionChanged events (or ones with similar purposes). Be able to send data (duh) When data is received, it fires the MessageReceived event on the same thread that the object was created on (this would b...

Visual Studio: Help to fix circular reference!

Hello Is there a way in Visual Studio 2005 to find all the references of a project? I have a solution with multiple projects (dll's). When referencing in the project B the project A VS tells me that it can't add this reference, because of a "circular referencing". However, the project A does not contain a direct reference to B. Appare...

Deserializing an xml stream with invalid values

I'm calling a "web service" that gives me as an xml response an invalid node, so when I try to deserialize it, it throws an exception. I'm using the XmlSerializer class, like so: internal class Response<T> { public Response(byte[] xml) { XmlSerializer s = new XmlSerializer(typeof(T)); XmlReader reader = XmlReade...