I found out this example
http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/135/Visual-Studio-LightSwitch-and-Windows-Phone-7-OData-Full-CRUD-Example.aspx
just edit the full code according like this:
public partial class EditProduct : PhoneApplicationPage
{
private static Uri LightSwitchApplicationUri =
new Uri("http://localhost/flowershop/ApplicationData.svc/");
private ApplicationData ApplicationDataContext;
private DataServiceCollection<flowershopservice.flowershopproduct> dsFlowerShopProducts;
public EditProduct()
{
InitializeComponent();
ApplicationDataContext = new ApplicationData(LightSwitchApplicationUri);
ApplicationDataContext.Credentials = new NetworkCredential("MaryDoe", "password#1");
}
#region OnNavigatedTo
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
string strId;
if (NavigationContext.QueryString.TryGetValue("Id", out strId))
{
if (strId != "-1")
{
int intId = Convert.ToInt32(strId);
var FlowerShopProductsQuery =
from FlowerShopProducts in ApplicationDataContext.FlowerShopProducts
where FlowerShopProducts.Id == intId
select FlowerShopProducts;
dsFlowerShopProducts =
new DataServiceCollection<flowershopproduct>(ApplicationDataContext);
dsFlowerShopProducts.LoadCompleted +=
new EventHandler<loadcompletedeventargs>(dsFlowerShopProducts_LoadCompleted);
dsFlowerShopProducts.LoadAsync(FlowerShopProductsQuery);
}
else
{
FlowerShopProduct objFlowerShopProduct = new FlowerShopProduct();
ApplicationDataContext.AddToFlowerShopProducts(objFlowerShopProduct);
this.ContentPanel.DataContext = objFlowerShopProduct;
}
}
}
#endregion
</loadcompletedeventargs></flowershopproduct></flowershopservice.flowershopproduct>