.net

.NET/WCF: Are WCF services on a different "tier" than ASP.NET?

At work, we have the UI layer (CSS, HTML, JavaScriptall executes in the browser), middle-tier (ASP.NET MVC and our C# libraryall executes server-side) layer, a service layer (WCF services that the middle-tier calls as-needed), and a DBO layer that WCF services use instances of. When the middle-tier (e.g. a static .cs class) calls a WCF ...

Strings with webservices. Making them not nullable?

Hi All, I want to expose a web method over web services like this, public bool AddApple(string colour); The trouble with strings is that you can pass a value of null. Is there a way to say that that string is non nullable? For instance in the entity framework the property has an attribute like this, [EdmScalarPropertyAttribute(Ent...

Java Vs .NET Vs Oracle(DBMS), Which technology is for Long Term Career?

I want to know about Which language is best for long term career and How? Which language should I choose among Java and .NET Platform or Should I choose Oracle like DBMS Language (SQL/PLSQL)? I am confused? Detailed answer would be appreciated. ...

Embed all References (DLLs) into Executable file

Hi Everyone, I'm creating a windows desktop application using .NET Framework (Visual Studio '08). As you know, when we build our application all references which we used in our application their dll copied into the Debug/Release folder with an executable file of application. Is it possible when you build only a single executable file pr...

How to make browser full screen on page load using javascript with timer control

I want a browser to go full screen as soon as my page loads. Is it possible in javascript. I know the shortcut key for this F11 but requirement is on page load only. After reading the solution provided below. I achieved full screen but here i got a trap. I was using timer to make my page postback to get fresh data after every 5 second. ...

BadImageFormatException - Is it possible to specify which .NET version is used to run an executable?

I'm running a .NET 2.0 executable with a .com extension from a command line and receiving the following error: System.BadImageFormatException : The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018) I'm pretty sure it's trying to load a DLL from the .NET 2.0 Global Assembly Cache. I only get thi...

Encryption and Decryption Key, where to store and what to use for .net application

We are designing a .net web application that has an external and internal site. Both sites need to encrypt data only the internal site needs to decrypt data. We are wondering what are the best practices for: Which encryption method to choose? Where to store the encryption / decryption key? ...

How is memory allocated for Hashtable?

When a hash table is initialized how is memory is allocated for it? When we add new members to it how does the memory used by the hash table get extended? Does it ever happen that a hash table is not able to store objects after a fixed size? ...

free tool to generate class diagram or method table from a C# assembly or project?

Is there a free, easy and quick tool which can generate class diagrams or maybe even a simple table containing the list of class and methods inside an C# assembly or a project? Basically what I need is just the list of class and methods in a readable format. It would be better if it takes the xml documentation as well, but it's not requi...

WPF - how to determine why this XAML style code is not working?

Any advice how to fault find to work out why the Grid.Resources styles in this XAML is not making any difference it seems to the end result? Note I'm using Charting from the WPFToolkit so to adjust how a chart looks it seems one has to apply the style areas (suggested by someone on the forum). So my question is generically, noting...

Where do I get Microsoft.GroupPolicy.Management.dll?

Having a look at this code http://msdn.microsoft.com/en-us/library/ee862406%28VS.85%29.aspx It says "Add the Microsoft.GroupPolicy.Management assembly to your project" but i cant seem to find out where to get Microsoft.GroupPolicy.Management from. ...

.NET/MVC2 data caching using Entity Data Models

I am having a strange caching problem and I believe it might be related to the fact that I am using a Entity Data Model as my data source. The problem is that I can update the database directly and it doesn't reflect on the actual site until I republish the project. The data does display properly when viewing the project locally. The o...

Write DB information to a file - good appraoch?

Hello, I have a DB and a mapping framework which was written by the company Im working for. So I have a class for each table in the DB and those classes allow to call the DB and get various information in DataSets or DataTables for example. Now I am supposed to write that information to a TXT file in a certain format (I have the specs ho...

Is the DataContext class specific to SQL Server?

The MSDN page for the DataContext class says: Represents the main entry point for the LINQ to SQL framework. Yet it looks like the constructors will take any ADO.NET IDBConnection. Am I right in thinking that a DataContext can wrap any ADO.NET connection? Or are there special things that need to be considered when using a connecti...

.NET Compatibility Limitations

Acorrding to the document I just read, global Windows compatibility for .NET Framework 3.5 is 10%: link This is not good news for my project where the installer is built in .NET and my application is C++. What are ways to combat this problem without having to require users to install any additional framework manually? ...

Why is the modifier set to Friend in Winforms?

When adding a new control to the designer in Winforms, the modifier on the control is set to Friend, but the default modifier is Private (right clicking the property and resetting the modifier). Does anyone know why? Is there a setting to set the modifier to default (Private)? ...

Question about System.OperatingSystem class

The following piece of code namespace ConsoleApplication1 { class Program { static void Main(string[] args) { OperatingSystem os = Environment.OSVersion; Console.WriteLine( os.Version.Major.ToString()); Console.ReadLine(); } } } Outputs 6 on both Vista and Win7 Ho...

DateTimeFormatInfo.InvariantInfo or null in ToString / TryParseExact

Hi, I'm wondering what is the difference for application between those two calls, in means of resulting DateTime object, whether TryParseExact will succeed, and result of ToString operation: DateTime.TryParseExact(value, "MMM yyyy", DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None, out conversionResult) DateTime.TryParseExact(val...

How to programatically find the bytecode (CIL) in a .Net executable/dll?

I would like to open a PE file (which i know is a .Net assembly) and find where the .Net bytecode is (ideally starting at the entrypoint). I know that the PE header data (entrypoint RVA) take me just to a stub which calls CorExeMain from mscoree.dll. This is not what i'm looking for though. I would like to find the bytecode that gets ru...

How can I call default(T) with a type?

In c# I can use default(T) to get the default value of a type. I need to get the default type at run time from a System.Type. How can I do this? E.g. Something along the lines of this (which doesn't work) var type = typeof(int); var defaultValue = default(type); ...