At first I thought something like:
var aName=getAllSomethings();
Is very unreadable, and so I'll use dynamic typing just when there's no room for confusion such as:
AClassName aName = new AClassName();
Here,
var aName=new AClassName();
seems readable.
But than I read (here) that dynamic typing also comes with a price in performa...
My question is what is needed and what are the restrictions of deploying a .Net web application to a specific server.
Does the server need to be running windows?
Does the server need to have the .Net framework installed on it? (is this possible with non-windows servers?)
Does the server need to have IIS installed on it? (is this poss...
I have a few classes to serialize, and deserialize, those classes implement an interface and thats all I really know at runtime about them.
The serialized xml is stored in a database and then, at some point I will need to deserialize this xml into a valid type.
I was thinking of using XmlSerializer , but the constructor requires that I...
Hi,
I wonder if someone can help me.
I'm using VS2010, .Net 4, EF4 and I'm trying to generate an objectcontext which is configured entirely in code (code-only as opposed to model-first or db-first).
In short, I do:
Create a ContextBuilder
Configure ContextBuilder for each entity (specifying PK, FKs, Nullable, etc.)
I ask the Contex...
Using C#, Visual Studio 2010.
There is a namespace called System.Web.Mvc documented on MSDN. The documentation for all the types in that namespace says that they are in System.Web.Mvc.dll.
However, when I go to Add Reference, “.NET” tab, this assembly is missing from the list. Why?
...
I can't seem to find a way to insert the method return type in a Resharper 5 macro. Can this be done?
For example, I have the following template:
Contract.Ensure(Contract.Result<$RESULTTYPE$>() != null);
I would like $REUSLTTYPE$ to be automatically filled with the data type of the current method, but I can't find a macro that woul...
I have a .NET 3.5 client/server application that is accessed via RDP on a local network running on a windows 2003 server. When using one portion of the product, the screen freezes periodically when none of the code I've written is actually executing. I've run a profiler on the server using the latest source code, etc. and when the dela...
I'm writing a software for a call-center. It's somewhat like a ATM program: user can only interactive with it, not with underlying Windows. It takes controls when user logs in to Windows, and when user exits, it logs off Windows.
How can I do that in .NET? A demo will be much appreciated.
Thank you.
...
[I have read previous posts on MEF vs MAF vs DI etc, they aren't helping me with my specific problem]
I am looking to write a .Net application (probably console or Windoes service) which will be extensible. It is an overnight/schedule app to extract data from a database, do something with it, and then output it (or pass it on to anothe...
I have a datagrid contains sensitive data, which is, only allows user to read, nothing more (no modifying, no copying,...). How can I archive that? Datagrid has Readonly property, but I think it does not prevent user from copying data.
EDIT: I don't need to prevent user completely from copying data, just not allow them to copy easily ma...
I really don't think it is possible on a reasonably easy way but I'm asking just in case. I'm working on Visual C# Express 2010. I want to do this because it would probably be the easiest way to make a trial version that expires after certain amount of runs. Maybe not very safe way, but don't need any more safety at the moment, just simp...
I'm coming from a background developing business applications so am used to MVC/n-Tier development.
Most of my applications have an architecture something like this:
GUI -> BL (which deals with entities) -> DAL (SQL DB)
Now, I'd like to write something which is a cross between an interactive story and a simulation - There is a persis...
I want to reference an URL having character entities using C#/.NET on an XmlReader instance, for example this w3c entity set defining and other chars.
If I were to accomplish it in pure XML it would something like this, or a variation:
<!ENTITY foo SYSTEM "http://example.org/myent.ent">
I'm actually reading fragments of XHTML...
String s = "test";
String is a class, so to use it we should create an object of it. But rather we just make a reference of it and give it a value. How is it possible and what concepts are used in it.
The metadata of String class shows the following :
public sealed class String : IComparable, ICloneable, IConvertible,
IComparable<st...
Hi Guys,
Suppose i have the following 2 SQL tables:
Foo
Column DataType
---------------------------
Title NVARCHAR(20)
Body NVARCHAR(MAX)
FooTypeId TINYINT
FooType
Column DataType
--------------------------
FooTypeId TINYINT
Name NVARCHAR(10)
Now, im using Entity Framework 4.0 with...
I want to delete a file that may or may not exist. I write
try { File.Delete(temp); } catch { }
Is there an easier way? Also I realize this ignores other exceptions as well but i dont care in this case.
...
Hi all,
As we know that during run time garbage collection request automatically when there is not enough space in memory to forming object. In my knowledge garbage collection call automatically, but when we do some programming in real world then it become indespensible to call garbage collection.let a example if we are making a program...
Hi all,
I am little bit confused about use of destructor in c#. In my knowledge we can't call
destructor acording to my wish it will call automatically before garbage collector for performing some work over class (object) so i want to ask if we are using destructor in c# then whe we need to garbage collector. As i know that destructor ...
I have a VirtualPathProvider that is loading my aspx file content from a DB. All seems to be well and good except when my aspx file has a reference to a namespace or assembly that is not explicitly mentioned in my web.config.
The solution seems easy right? Add assembly and import directives to the page... But that doesn't seem to work. ...
I've been given a .net project to maintain. I was just browsing through the code and I noticed this on a property declaration:
public new string navUrl
{
get
{
return ...;
}
set
{
...
}
}
I was wondering what does the new modifier do to the property?
...