Getting Started with Entity Framework 4.0 Screencast Recorded session from Cairo Code Camp - Part 5

by mosessaur| 24 September 2010| 0 Comments

About Part 5

Fifth part is about 9:45 min in length. Part 5. Covers EDM -Entity Data Model- showing its elements (SSDL, CSDL & MSL). Also this screencast shows how to query your conceptual model using LINQ to Entities.

More...

Getting Started with Entity Framework 4.0 Screencast Recorded session from Cairo Code Camp - Part 4

by mosessaur| 07 August 2010| 0 Comments

About Part 4

Fourth part is about 10 min in length. Covers how to implement table per hierarchy inheritance model (TPH) with Entity Framework 4.0

More...

Getting Started with Entity Framework 4.0 Screencast Recorded session from Cairo Code Camp - Part 3

by mosessaur| 10 July 2010| 0 Comments

About Part 3

Third part is about 8:20 min in length. Covers how to use stored procedures with EF4 to do CRUD operations on the database. The demo shows how to do mapping to existing stored procedures. The Demo also shows how to use IntilleTrace to view executed statements made by EF object services.

More...

Getting Started with Entity Framework 4.0 Screencast Recorded session from Cairo Code Camp - Part 2

by mosessaur| 18 June 2010| 0 Comments

About Part 2

Second part is about 6:30 min in length. Covers Object Services and how to do CRUD operations using EF 4.0 object services. The demo explores EF change tracking capabilities. The demo also shows how to map return result of a stored procedure to existing entity in your EDM.

More...

Open Data Protocol Visualizer Extension for VS2010 – Screencast

by mosessaur| 03 May 2010| 3 Comments

Last week I introduced a screencast talking about OData Visualizer Extension for VS2010 on http://odataprimer.com community.

It’s a How-To video on how to download, install and start working with OData Visualizer Extension for Visual Studio.Net 2010. OData Visualizer is an extension for VS2010 made by Microsoft Data Modeling team

I case you missed it, you can watch it on ODataPrimer website. You can also download an HD video (~35Mbs).

You can also subscribe to ODataPrimer channel on yourtube for future updates and videos.

Hope you’ll enjoy it.

.Net 3.5 Enhancements Training Kit

by mosessaur| 19 April 2008| 0 Comments

Brief Description:
.NET Framework 3.5 Enhancements Training Kit containing Labs, Demos and PPTs.

Overview:
The .NET Framework 3.5 Enhancements Training Kit includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the .NET 3.5 Enhancement features including: ASP.NET MVC, ASP.NET Dynamic Data, ASP.NET AJAX History, ASP.NET Silverlight controls, ADO.NET Data Services and ADO.NET Entity Framework.

I think it is different thanThe Visual Studio 2008 and .NET Framework 3.5 Training Kit which you can also have a look at it.

You can subscribe to Microsoft Download Notificationsto alwasy be updated about new downloads from Microsoft.

Download

WebResourceAttribute And VB.NET, Not Like in C#!

by mosessaur| 17 February 2008| 0 Comments

Refering to my previous post "Working with System.Web.UI.WebResourceAttribute". During surfing in ASP.NET forums I noticed a question about this issue! and in the question it is mentioned that the way I descriped didn't work. I noticed also that the guy was using VB.NET not C# on which I was working on!!

The deference, or the issue came up because C# & VB.Net treat or compile resources in deferent ways -this is my own observation-. Return to the issue post on ASP.NET Forums to know what was exactly the problemand how it was resolved.

kick it on DotNetKicks.com

Working with System.Web.UI.WebResourceAttribute

by mosessaur| 17 February 2008| 1 Comments

You may've heared about new ASP.NET 2.0 System.Web.UI.WebResourceAttribute class. It defines the metadata attribute that enables an embedded resource in an assembly. It is valid only when used on assembly declarations and it is used to enable a specified embedded resource in an assembly for use as a Web resource.

For example, suppose you are building a web server control, or custom HttpHandler that would render some javascript "js" files and may few images etc...
Where you would store these files "resources"?! The answer is you can embed them in your assembly and reference them as web resources from your code.

To register a resource as WebResource you would use this line of code, you can do that in AssemblyInfo file:

[assembly: System.Web.UI.WebResource("imagename.jpg", "image/jpeg")]

For more information about WebResource parameter, please return to MSDN, currenlty I can mention that the 1st on is the resource name, and the 2nd one is the content-type of the resource, in our case it is an image so the content type is image/jpeg. If your resouece file is javascript, then the content-type would be text/javascript

And you can reference your resource using ClientScriptManager class through Page.ClientScript Property as the following

string resUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(YouControlType), "imagename.jpg");

Now use your resUrl to display your image!.... BUT WAIT, this is not going to work!!

If you followed the MSDN code while you are VS.NET this is not going to work at all, your image or your resource file never appear.
Here are the Rule:

  1. You should know your Assembly default namespace.
  2. Recognize where exactly your resource file located in your project, "Its Path"
  3. Define the correct resource name.

Suppose your default namespace is Moses.WebControls, while your resource file name is ComboBox.js, this file is located on a folder named Resources/Scripts in your project -Dont care about your project name or assembly name, just focus on your Default namespace name-.

Now your resource file should be name "Moses.WebControls.Resources.Scripts.ComboBox.js".

The rule simpley is [Default namespace].[Resource Path from the project root -replace '/' with '.' of course-].[Resource FileName]

So you'll register your WebResource as the following:

[assembly: System.Web.UI.WebResource("Moses.WebControls.Resources.Scripts.ComboBox.js", "text/javascript")]

And you can get your resource URL as the following:

string resUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(YouControlType), "Moses.WebControls.Resources.Scripts.ComboBox.js");

Hope this would help somebody

kick it on DotNetKicks.com

Tip: Generating Local Resource Files

by mosessaur| 17 February 2008| 1 Comments

As I was working on multingual User Interface project; it was needed to generate resource files for all aspx & ascx files.
I knew that VS.NET 2005 has a local resource file generator. But it was weird when I select my ASPX page or user control and go to Tool menu and find that there are no Generate Local Resources command on the menu!

It didn't take so much time, I found the solution on ASP.NET Forums. It was simple: "he menu 'Tools > Generate Local Resources' is available when you display an aspx page or ascx". Also you must switch to design veiw before you Generate your local resources.

kick it on DotNetKicks.com

How to build Multi-Language Web Sites with ASP.NET 2.0 and Visual Studio.Net 2005

by mosessaur| 17 February 2008| 1 Comments

Last year I wrote an article about how to build multi-languange web sites with ASP.NET 2.0 and Visual Studio.Net 2005. This is a bookmark to the articles (C#,VB.NET) [poste migrated from old blog]

Introduction: In order to reach international markets through the Internet, supporting different cultures through our applications is essential for being successful. The .NET Framework 2.0 as well as 1.x comes with an integrated infrastructure for creating international applications. Basically, the CLR supports a mechanism for packaging and deploying resources with any type of application. The CLR and the base class library of the .NET Framework come with several classes for managing and accessing resources in applications. These classes are located in the System.Resources and System.Globalization namespaces. Here we will explore the necessary details for working with resources in ASP.NET applications and for creating international ASP.NET applications based on embedded resources and the integrated localization support.

Assumptions: This article assumes that you already know how to build web forms and to use controls and validation controls.

Localization and resource files: Localization support in .Net Framework 2.0 in general and in ASP.Net 2.0 specifically become much more easier and brings fun during localization process. Usually resources are created for every culture the application should support. More specifically, each Web Form -Page- in your web site should have a resources for every culture -language- it should support. For example:If you have a web form with name default.aspx and your web site support English, German and Arabic, then you should have 3 resource files for each culture. The CLR defines a behavior for finding culture-specific resources. With that said, every set of resources has to define a base name that is specified through the first part of the name of the resource file. The second part of the name defines the culture. If the culture portion in the name is not specified, the resources defined in the resource file are used as default resources. For example:Your page name is default.aspx., you have 3 resource files as mentioned earlier, each one resource file should be named as:default.aspx.en-US.resx, default.aspx.de-DE.resx and default.aspx.ar-EG.resx. Not here that we are using United States English, German's Gemran, and Egyptian's Arabic. You can use general English or general German or general Arabic like this:default.aspx.en.resx, default.aspx.de.resx and default.aspx.ar.resx. Also you can use another specific culture like using Switzerland German culture this way: default.aspx.de-CH.resx. For list of supported cultures in .Net Framework return to MSDN.

Read the complete article at C-SharpCorner.com
Read the VB.Net version as VBDotNetHeaven.com

kick it on DotNetKicks.com