.net

Enterprise Library Unity vs Other IoC Containers

Hi, What's pros and cons of using Enterprise Library Unity between other IoC (Windsor ..) ...

Best way to repeat a character in C#

Hi, What it's the best way to generate a string of \t's in C# I am learning C# and experimenting with different ways of saying the same thing. Tabs(uint t) is a function that returns a string with t amount of \t's For example Tabs(3) returns "\t\t\t" Which of these three ways of implementing Tabs(uint numTabs) is best? Of course ...

Possible to call Oracle FUNCTION from .Net using Enterprise Library?

I have the following Oracle function: function get_job_no return number is V_job_no number; begin select appwork.tlm_corphier_job.nextval into V_job_no from dual; return V_job_no; end get_job_no; PLEASE NOTE: 1) This is a FUNCTION, not a procedure 2) This is returning a NUMBER, not a VARCHAR 3) I ...

NHibernate with string primary key and relationships

I've have just been stumped with this problem for an hour and I annoyingly found the problem eventually. THE CIRCUMSTANCES I have a table which users a string as a primary key, this table has various many to one and many to many relationships all off this primary key. When searching for multiple items from the table all relationships ...

How random is System.Random in .net 3 ?

I am currently writing a simple password generator (C#). For that I need some random Numbers. Is it OK to simply use the Random Class that ships with .NET or are there any known problems with that? ...

Implementing IHttpSecurity in .NET (managed code)

How can I implement IHttpSecurity for Webbrowser Control in .NET? I couldn't find any examples, all examples are in C++, also MSDN documentation is only for C++ ...

String value that represents an email attachment, how to store to disk/db?

Ok it turns out this 3rd party component I am working with stores an email attachment in a property of string type (it is already decoded). How would I store this to file now? It has: filename, encodingtype and the string representation of the file. ...

C# (.NET) Design Flaws

What do you think are the biggest design flaws in C# or the .NET Framework in general? My favorites are that there's no non-nullable string type and that you have to check for DBNull when fetching values from an IDataReader. ...

Testing Line-of-Business (LOB) .NET Applications?

Hello all, I was wondering if anyone here has experience in unit testing LOB applications (typically CRUD). I have dabbled in the built-in unit testing tools in Visual Studio, but I have found it difficult to run tests that hit a database. Since the data changes, and combined with the fact that I have little idea what I'm doing, it se...

How to request an aborted HttpWebRequest again?

My objective is to retry an asynchronous HttpWebRequest when it fails. When I Abort() an HttpWebRequest, I cannot BeginGetResponse() again. So the only way to request again probably is recreate the HttpWebRequest object. It seems to require a lot of work since I would have to copy all properties from the old object. Is there any shortcu...

Best way to build a hot pluggable WCF service library

I have been working on a WCF service library where hopefully all the business logic will end up living. The problem that I am running into is that sometimes I have to make quick fixes to a service and in order to apply those fixes I have to stop the Windows Service, replace the service dll and then restart the Windows service. This is go...

TDD - How much do you test?

I'm working on a new project and I'm using the repository pattern, I have my repository that pulls the data from the database and a "service" class which uses the repository and does all the business logic. something similar to the following; public class UserRepository : IUserRepository { public IQueryable<User> GetUsers() { ...

How do I find which port number .Net Remoting Allocates?

If I create a TcpChannel using port zero i.e. allowing .Net Remoting to allocate an available port, is there anyway to then determine which port number has been allocated? I know that I can specify the port number when creating the channel, however I don't want to do this as I want to run multiple instances of the listening applicatio...

How can I get a process' cpu usage percentage?

How can I get a process' cpu usage percentage ala-Task Manager? I used the PerformanceCounter class but it's 'performance' is not optimal for the app that i'm doing. Is there an alternative method to do this? Thanks! ...

Frameworks available to .NET

I would like to build an application that will run on a web, this is for an enterprise solution, but I don't know what kind of framework that I'll be using, does anyone out there could recommend a framework that is best suited in .NET/ASP.NET application that could handle DAL, BLL and GUI, other than CSLA.NET? ...

ORM and SOA in the .NET world

From my experience the major ORM frameworks for .NET (NHibernate, LinqToSql, Entity Framework) work best when they keep track of loaded objects. This works fine for simple client-server applications, but when using three- or more tier architecture with Web Services in a Service Oriented Archtitecture, this is not possible. Eventually, by...

Dynamically Generating RadioButtonList

Hi All I'm going to generate an asp:CheckBoxList using this code <% System.Collections.Generic.List<QuizzEngine.Common.Question> qList = (System.Collections.Generic.List<QuizzEngine.Common.Question>)Session[QuizzEngine.Common.SessionKeys.QuesionsList]; int navigator = (int)Session[QuizzEngine.Common.SessionKeys.Navigator]; if (**Tru...

NHibernate.Search with Lucene.NET without using DB?

Could I use NHibernate.Search only with lucene’s index without database? Because I would like to store all data only in my lucene’s index, but I really like features in NHibernate.Search. ...

ORM Entity Xml Serialization

I am looking for an ORM to use with .net, I need to be able to do full graph serialization to Xml on the entitys the ORM generates. My own research leads me towards using the WCF and the Entity Framework to achieve this, Is this the best option or is there a simpler way ? ...

Registering object _instances_ instead of _types_ with .NET remoting?

There's something I'm just not getting about .NET remoting. Well, two things actually: Why is the emphasis back on classes that inherit from MarshalByRef instead of interfaces ala the original COM style (which I liked)? Why is it that .NET remoting always forces you to effectively create some sort of object pool instead of allowing you...