TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vijay
NA
150
90.4k
Silverlight Application with WCF Service and EntityFramework
Sep 2 2013 7:08 AM
I am creating Silverlight Application with using WCF Services and Entity Framework
for Insert,Select,Update and
Delete
using of
DataGrid
.
I got results from Insert,Select,Update but in
delete
i write code like dis
Person - is Class
I used this fields - ID (PK), Name, Age
WCF :
SampleEntities DataContext { get; set; }
public bool Delete(Person model)
{
DataContext = new SampleEntities();
DataContext.People.Remove(model);
DataContext.SaveChanges();
return true;
}
xaml.cs:
private void btnDelete_Click(object sender, RoutedEventArgs e)
{
if (SelectingPerson != null)
{
PersonServiceClient sClient = new PersonServiceClient();
sClient.DeleteCompleted += sClient_DeleteCompleted;
sClient.DeleteAsync(SelectingPerson);
}
}
void sClient_DeleteCompleted(object sender, DeleteCompletedEventArgs e)
{
if (e.Error == null && e.Cancelled == false)
{
bool del = e.Result;
MessageBox.Show("Row was Deleted !!");
}
if (e.Error != null)
{
MessageBox.Show(e.Error.Message);
}
}
I getting
error
like this,
"
CommunicationException was unhandled by user code;The remote server returned an error: NotFound
".
Thanks !
Reply
Answers (
1
)
Client acess policy
Datagrid using Silvelright 5