"Logic will get you from A to B. Imagination will take you everywhere." A. Einstein
Welcome to MSDN Blogs Sign in | Join | Help

"Novell on Monday will offer a kit for developers to build Apple iPhone and iPod Touch business applications using Microsoft's .Net Framework instead of the Apple-designated C or Objective-C languages"

""What's important here is that C# and .Net are considerably more productive development environments than the native iPhone language, which is Objective-C," said Miguel de Icaza, vice president of the developer platform at Novell and the leader of the Mono project.  With MonoTouch, the Mono runtime provides such developer services as garbage collection, thread management, type safety, and Web services, de Icaza said."

Source: http://www.infoworld.com/print/91194

Even if I am not an enthusiastic gamer I can't stop to admire the progresses done in this project. The voice, face and body recognition at its best. Here is the link: http://www.xbox.com/en-us/live/projectnatal. This is the future for the human-computer interaction. Enjoy it !

Windows 7 RC is now available to the TechNet/MSDN subscribers, and on May 5th will be available at http://www.microsoft.com/windows7 for partners, IT pros, and tech enthusiasts to pilot Windows 7 RC at work and at home.

Here is the Windows 7 team blog : http://blogs.msdn.com/e7/default.aspx

 

Today I was struggling to obtain in SQL Server 2005 the list of groups (from Active Directory) to which a user belongs to. Here is the final result. Enjoy it!

EXEC master.dbo.sp_addlinkedserver @server = N'ADSI',
@srvproduct=N'Active Directory Services', @provider=N'ADsDSOObject',
@datasrc=N'corp.abc.com'
GO

/* get the groups for the user Test1*/
select * from openquery
(
ADSI,'SELECT name 
FROM ''LDAP://abc.com''
WHERE objectCategory = ''Group'' AND objectClass = ''group''
AND member=''CN=Test1,CN=Users,DC=abc,DC=com''
')

Many companies are building their own base classes wrapping the native UI classes (in order to be able to customize them). 

Here a proof-of-concept how you can do Window and UserControl inheritance in WPF.

- The DemoWPFBaseClassesLib : contain the 2 base class for the Window and for the UserControl (both are changing the background color)
public class MyBaseWindow : Window
public class MyBaseUserControl : System.Windows.Controls.UserControl
- The UserControls library DemoWpfBaseClassesUCLibrary with one UserControl derived for the base one
public partial class UserControl1 : MyBaseUserControl
- The standalone WPF application DemoWPFBaseClasses with the main window derived from the base one
public partial class Window1 : MyBaseWindow
There are also changes to do in the XAML files (corresponding to the derived classes) - see the text in yellow:

- For the Window:
<src:MyBaseWindow x:Class="DemoWPFBaseClasses.Window1"
    xmlns="
http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml"
   
xmlns:src="clr-namespace:DemoWPFBaseClassesLib;assembly=DemoWPFBaseClassesLib" 
    xmlns:my="clr-namespace:DemoWpfBaseClassesUCLibrary;assembly=DemoWpfBaseClassesUCLibrary"
    Title="DemoWPFBaseClasses" Height="300" Width="300">
    <Grid>
        <Button Width="74" Height="24" Content="Test" HorizontalAlignment="Left" Margin="12,12,0,0" VerticalAlignment="Top"></Button>
        <my:UserControl1 Width="200" Height="100" HorizontalAlignment="Left" Margin="12,51,0,0" VerticalAlignment="Top"></my:UserControl1>
    </Grid>
</src:MyBaseWindow>

- For the UserControl:
<runtime:MyBaseUserControl x:Class="DemoWpfBaseClassesUCLibrary.UserControl1"
   
xmlns:runtime="clr-namespace:DemoWPFBaseClassesLib;assembly=DemoWPFBaseClassesLib"
    xmlns="
http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml"
    Height="100" Width="200">
    <Grid>
        <TextBox Height="23" Margin="12,12,0,0" Name="textBox1" VerticalAlignment="Top" HorizontalAlignment="Left" Width="120" />
    </Grid>
</runtime:MyBaseUserControl>

Yesterday Microsoft published a first series (9 from 40) of "How Do I" videos with code snippets for the Azure Services Platform.

For a high-level view, on this site you can see a list of case studies about how other companies are using the Azure Services Platform. For a more technical level you can download the Developer SDKs to experiment Azure locally.

If you want to request access to the Azure CTP, go to the http://connect.microsoft.com/ site and sign up for the access tokens.

Have fun !

 

It was released an improved structure for the patterns & practices node in the MSDN Library.

You can find the new top level page here: http://msdn.microsoft.com/en-us/library/ms998572.aspx

The catalog of p&p offerings has now couple general categories like:  Solution Development Fundamentals, Client Development, Server Development, and Services Development making easier to navigate.

It also clarify which releases are current (for use with the current versions of Microsoft products and technologies), which are previous but still useful, and which releases are retired and should no longer be used.

"WCF does not support the use of SOAP extensions, but it does have other extensibility points that can be used to intercept and manipulate SOAP messages. For example, you can use a behavior extension to hook into the WCF Dispatcher with a class that implements IDispatchMessageInspector."

See here a sample application (proof of concept) how to do it. Take a look especially at the :

class TraiterMessageInspector: IClientMessageInspector, IDispatchMessageInspector

class CustomEndPoint : IEndpointBehavior

and the configuration in web.config

Here is a very interesting site about the "Microsoft Cloud Computing Tools" : Windows Azure and Live Framework

"Windows Azure is the development, hosting, and management environment of the Azure Services Platform, which enables you to run applications at Internet scale while leveraging the skills and tools you use today.

Windows Azure Tools for Microsoft Visual Studio extend Visual Studio to enable the creation, building, debugging, running, and packaging of scalable services on Windows Azure.

The Live Framework is the uniform way for programming Live Services from a variety of platforms, programming languages, applications and devices. With the Live Framework, you can easily build and deploy applications in the cloud that sync across multiple devices."

This is the next step in my previous sample (see the previous post from this month). Now I want to add and delete products using my Web service and EF.

The problem I found: I had to go back to the database and set a cascade delete for the FK_ProductInventory_Product (because I forgot to do it initially). Then I did an update of the EF model. The .edmx file was not quite updated... in the SSDL section I found the expected code:

<Association Name="FK_ProductInventory_Product">
<End Role="Product" Type="ProductionModel.Store.Product" Multiplicity="1">
<OnDelete Action="Cascade"> />
</End>

but on the CSDL section it was only:

< Association Name="FK_ProductInventory_Product">
<End Role="Product" Type="ProductionModel.Product" Multiplicity="1" >
<End Role="ProductInventory" Type="ProductionModel.ProductInventory" Multiplicity="*"/>
</Association>>

so I had to add manually the OnDelete part:

<Association Name="FK_ProductInventory_Product">
< End Role="Product" Type="ProductionModel.Product" Multiplicity="1" >
<OnDelete Action="Cascade"></OnDelete>
</End >
<End Role="ProductInventory" Type="ProductionModel.ProductInventory" Multiplicity="8"/>
</Association>
and now it's working fine. I used VS2008 (.NET3.5 SP1) on Windows Vista. I will ask the product team if it's a known bug...

Here is the code (on the server side) for adding one product, adding a list of products and delete a product

///
/// delete the product and all the childs
///

///
///
public int DeleteProduct(Guid prodId)
{
try
{
var product = (from prod in productionContext.Products.Include("ProductInventory")
where prod.ProductID == prodId
select prod).First();
if (product != null)
{
this.productionContext.DeleteObject(product);
return this.productionContext.SaveChanges();
}
return 0;
}
catch (InvalidOperationException ioex)
{
throw ioex;
}
catch (Exception ex)
{
throw ex;
}
}
///
/// add a product with details
///

///
///
///
///
///
///
public int AddProduct(string name, decimal price, string shelf, string bin, string location, string city)
{
try
{
Product product = Product.CreateProduct(Guid.NewGuid(), name);
product.Price = price;
product.ModifiedDate = DateTime.Now;
product.IsNewFlag = true;
ProductInventory inventory = ProductInventory.CreateProductInventory(Guid.NewGuid());
inventory.Bin = bin;
inventory.Shelf = shelf;
inventory.Location = Location.CreateLocation(Guid.NewGuid());
inventory.Location.Description = location;
inventory.Location.City = city;
product.ProductInventory.Add(inventory);
this.productionContext.AddToProducts(product);
return this.productionContext.SaveChanges();
}
catch (InvalidOperationException ioex)
{
throw ioex;
}
catch (Exception ex)
{
throw ex;
}
}
///
/// add a product list with children
///

///
public int AddProduct(List list)
{
try
{
if (list != null & list.Count > 0)
{
foreach (Product p in list)
{
this.productionContext.AddToProducts(p);
}
return this.productionContext.SaveChanges();
}
return 0;
}
catch (InvalidOperationException ioex)
{
throw ioex;
}
catch (Exception ex)
{
throw ex;
}
}

Couple days ago I started a simple application (WCF Web service using Entity Framework to access a SQL DB and a WPF client).
In the SQL database I had 3 tables - mainly a many-to-many relation.
Now I need to get more data: I want to obtain all the Products and for each Product to get the details : from ProductInventory (which is related to Product) and from Location (which is related to ProductInventory) tables.
On the server side I am using twice the Include method and that's it ! So simple and clean !

///
/// get all products ordered by name
///

/// if getWithDetails=true get the details from the 2 related tables
///
public List GetProducts(bool getWithDetails)
{
try
{
ObjectQuery prodList = this.productionContext.Products;
return (getWithDetails) ? prodList.Include("ProductInventory").Include("ProductInventory.Location").OrderBy("it.Name").ToList()
: prodList.OrderBy("it.Price").ToList();
}
catch (InvalidOperationException ioex)
{
throw ioex;
}
catch (Exception ex)
{
throw ex;
}
}

You can see how it looks on the client side.
And below you can donwload the source code.

For those who are looking for more WPF functionalities, there is a "project" on CodePlex called: Windows Presentation Foundation (WPF).
"This project is the portal for accessing the WPF Toolkit and the WPF Futures releases.
The WPF Toolkit is a collection of WPF features and components that are being made available outside of the normal .NET Framework ship cycle."
It contains controls like: DatePicker, Calendar, DataGrid, VisualStateManager.

For those interested in some AJAX samples, here are the code samples for the book "ASP.NET AJAX In Action" published by Manning.
This January 2009 release can be compiled also with ASP.NET 3.5.

Hello and Happy New Year 2009 !

Here is a sample code I wrote to show you how to create a WCF Web service which is using Entity Framework to access a SQL 2008 database.

Here are the main steps:

1 - create your SQL database (Products) with the 3 tables : Product, ProductInventory and Location. See the tables here.

2 - create a WCF Web service (ProductsService) with one method: List<Products> GetProducts()

3 - create a class library (DataLibrary) with the ProductsModel (the Entity Model for the 3 tables) and one class : ProductManager (which has the context and the business logic)

4 - in the Web service method call the ProductManager method to obtain the list of products

5 - copy the connexion string from the DataLibrary to the Web service's config file

6 - create a WPF client, add a reference to the Web service and bind the list of products to a listbox

And this is it. See the running program here. The source code is in the attached zip file (Visual Studio 2008).

J'ai eu un client qui m'a posé la question suivante: 

Quelle est la meilleure stratégie pour graduer (déployer une version) une application SharePoint d'un environnement d'essais à un autre environnement d'essais jusqu'en production?

Et voila un article tres interessant sur MSDN qui donne la reponse: Team-Based Development in SharePoint Server 2007 .

Bref, en organisant le developpment dans des assemblies(Feature/Solution package) et artifacts(items in a list, MOSS groups).

More Posts Next page »
 
Page view tracker