Saturday, August 22, 2009

entity framework model

Entiry FrameWorkModel

.edmx is an xml file that defines an Entity Data Model (EDM) ,Describe the target database schema ,and defines the mapping between the EDMI and the database.An .edmx file also contains information that is used by the ADO.NET entry datamodel Designer to render a model graphically.

How to Add .edmx File in a visual Studio project ?

Right Click on Solution Explorer -> New Item -> Select ADO.NET Entity Data Model .As shown in the figure




Note : In MVC application the .edmx file can be added in the Model .So it act as a Model for MVC

In Entity framework model it is same as LINQ to SQL .But here we can mix and match a number of different database vendors ,application servers or protocols to design an aggregated mash-up of objects which are constructed from a variety of tables,sources services etc.ADO.NET is released with .Net Framework 3.5 service pack 1.

Wednesday, August 19, 2009

HTTP Error 500.19 - Internal Server Error iis

When i started to work IIS 7.0 in vista . I got an error HTTP Error 500.19 - Internal Server Error iis. I checked with the IIS features(control panel -> programs and Features -> Turn windows features on or off ) There the Internet Information Services -> World Wide Web -> Services Application Features are not selected. When i selected as shown in the below image.Now evey thing is working.


Note : World Wid Publishing Service - provides web connectivity and adminstration through the internet information Service Manager

My problem got solved . Now every thing is working.

Dynamic LINQ

Linq Example :

var query = from g in db.Goan_Classifications
orderby g.Goan_Classification_Name
select g;

Dynamic Linq Example :

var query = db.Goan_Classifications.OrderBy("Goan_Classification_Name");

So it makes more easy.But the thing is that we need to use the system.Linq.Dymaic class,Which makes the development more easy.

Read More

Saturday, August 15, 2009

Linq to Sql Debug Visualizer

Probably the biggest programming model improvement being made in .NET 3.5 is the work being done to make querying data a first class programming concept. We call this overall querying programming model "LINQ", which stands for .NET Language Integrated Query.Read More

Wednesday, August 12, 2009

Assembly Binding Log Viewer (Fuslogvw.exe)

The Assembly Binding Log Viewer displays details for assembly binds. This information helps you diagnose why the .NET Framework cannot locate an assembly at run time. Read more

Tuesday, August 11, 2009

TimeZoneInfo vs TimeZone

The TimeZone class is new in 3.5 . This contains the information of Time zone in the world.
E.g :
static void Main(string[] args)
{
TimeZoneInfo tInfo = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time");
DateTime dTime = DateTime.UtcNow;
DateTime localTime = TimeZoneInfo.ConvertTimeFromUtc(dt, mountain);
}

MSDN link
Finding the Time Zones

TimeZone

TimeZone(.Net 1.0) is to get the CurrentTimeZone(ie local time zone only) . So based on local time zone only we can convert it into necessary DateTime. But in TimeZoneinfo class helps to convert into DateTime based on any TimeZone in the World.

E.g : for TimeZone


static void Main(string[] args)
{
TimeZone tZ = TimeZone.CurrentTimeZone;
DateTime dT = DateTime.UtcNow;
}


Monday, August 10, 2009

Windows 8

Few days back windows 7 released(July-22-2009) into market.But the thing is that Microsoft is working on Windows 8 .To read more

Monday, August 3, 2009

Visual studio Background Images

Try this out to change the style of visual studio and Get Coding reports and related.

Mutable vs Immutable

Why string is immutable and StringBuilder is mutable ?
string builder is mutable .Ie it is pure reference type.The following example the 'foo' is passed as a reference type .So the output is helloanish:
E.g:
class Program
{
static void Main(string[] args)
{
StringBuilder y =new StringBuilder();
y.Append("hello");

Program p = new Program();
p.foo( y);
Console.WriteLine(y );
}

void foo(StringBuilder sb)
{
sb .Append("anish:");
}
}

Stirng is immutable .In some ways it to be value types .These are known as immutable .The following example the 'foo' is passed is a string but this act as a value type .So the output is 'hello'

E.g:

class Program
{
static void Main(string[] args)
{
string y =string.Empty;
y="hello";

Program p = new Program();
p.foo( y);
Console.WriteLine(y );
}

void foo(string sb)
{
sb +="anish:";
}
}

Note : note only string .Some of the other types also.

Rather than creating a new storage location for the function member declaration,the same storage location can be used with the help of ref type.


E.g : class Program
{
static void Main(string[] args)
{
string y ="";
y="hello";

Program p = new Program();
p.foo(ref y);
Console.WriteLine(y );
}

void foo(ref string sb)
{
sb="anish:";
}
}

Output is not hello,its anish

Out type :Same a ref .The thing is that initially the variable is unassigned.
 
Counter