i need to show mesage box that show "RECORED ALreay exist ind datatabse "
uisng linq and silverlight
have single on code
.xaml fiel code is here
private void createSurvey_Click(object sender, RoutedEventArgs e)
{
Service3Client client = new Service3Client();
//Int32 i;
client.CheckSurveyExistAsync(this.Title.Text, this.SurveyQuestion.Text, this.Surveyoption1.Text, this.Surveyoption2.Text, this.Surveyoption3.Text);
}
and service3.cs code is here
public void CheckSurveyExist(string Title, string question, string option1, string option2, string option3)
{
DataClasses2DataContext db2 = new DataClasses2DataContext();
int highScoreCount =
(from c in db2.Surveys
where c.SurveyTitle == Title
select c).Count();
if (highScoreCount > 0)
{
return ;
}
else
{
InsertSurveyData(Title, question, option1, option2, option3);
//return 0;
}
}