erummirza
10-04-2010, 01:55 AM
i m geeting silverligth error
Error 1 'int VotingPanel2.CreateSurveyForm.client_CheckSurveyExistCompleted(object, VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs)' has the wrong return type C:\Users\Iram\Documents\Visual Studio 2008\Projects\VotingPanel2\VotingPanel2\CreateSurveyForm.xaml.cs 24 49 VotingPanel2
Error 2 No overload for method 'CheckSurveyExistAsync' takes '0' arguments C:\Users\Iram\Documents\Visual Studio 2008\Projects\VotingPanel2\VotingPanel2\CreateSurveyForm.xaml.cs 26 13 VotingPanel2
Error 3 'VotingPanel2.CreateSurveyForm.client_CheckSurveyExistCompleted(object, VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs)': not all code paths return a value C:\Users\Iram\Documents\Visual Studio 2008\Projects\VotingPanel2\VotingPanel2\CreateSurveyForm.xaml.cs 33 14 VotingPanel2
Error 5 Cannot implicitly convert type 'void' to 'int' C:\Users\Iram\Documents\Visual Studio 2008\Projects\VotingPanel2\VotingPanel2\CreateSurveyForm.xaml.cs 44 17 VotingPanel2
here is piece of code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using VotingPanel2.ServiceReference3;
namespace VotingPanel2
{
public partial class CreateSurveyForm : Page
{
public CreateSurveyForm()
{
InitializeComponent();
VotingPanel2.ServiceReference3.Service3Client client = new VotingPanel2.ServiceReference3.Service3Client();
client.CheckSurveyExistCompleted += new EventHandler<VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs>(client_CheckSurveyExistCompleted);
client.CheckSurveyExistAsync();
}
// Executes when the user navigates to this page.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
}
int client_CheckSurveyExistCompleted(object sender, VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs e)
{
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Service3Client client = new Service3Client();
int a;
a = client.CheckSurveyExistAsync(this.Title.Text);
}
}
}
here is service code
public int CheckSurveyExist(string Title)
{
DataClasses2DataContext db2 = new DataClasses2DataContext();
DataClasses2DataContext db2 = new DataClasses2DataContext();
///IEnumerable<int> highScoresQuery3 =
int highScoreCount =
(from c in db2.Surveys
where c.SurveyTitle == Title select c).Count() ;
return highScoreCount;
}
Error 1 'int VotingPanel2.CreateSurveyForm.client_CheckSurveyExistCompleted(object, VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs)' has the wrong return type C:\Users\Iram\Documents\Visual Studio 2008\Projects\VotingPanel2\VotingPanel2\CreateSurveyForm.xaml.cs 24 49 VotingPanel2
Error 2 No overload for method 'CheckSurveyExistAsync' takes '0' arguments C:\Users\Iram\Documents\Visual Studio 2008\Projects\VotingPanel2\VotingPanel2\CreateSurveyForm.xaml.cs 26 13 VotingPanel2
Error 3 'VotingPanel2.CreateSurveyForm.client_CheckSurveyExistCompleted(object, VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs)': not all code paths return a value C:\Users\Iram\Documents\Visual Studio 2008\Projects\VotingPanel2\VotingPanel2\CreateSurveyForm.xaml.cs 33 14 VotingPanel2
Error 5 Cannot implicitly convert type 'void' to 'int' C:\Users\Iram\Documents\Visual Studio 2008\Projects\VotingPanel2\VotingPanel2\CreateSurveyForm.xaml.cs 44 17 VotingPanel2
here is piece of code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using VotingPanel2.ServiceReference3;
namespace VotingPanel2
{
public partial class CreateSurveyForm : Page
{
public CreateSurveyForm()
{
InitializeComponent();
VotingPanel2.ServiceReference3.Service3Client client = new VotingPanel2.ServiceReference3.Service3Client();
client.CheckSurveyExistCompleted += new EventHandler<VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs>(client_CheckSurveyExistCompleted);
client.CheckSurveyExistAsync();
}
// Executes when the user navigates to this page.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
}
int client_CheckSurveyExistCompleted(object sender, VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs e)
{
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Service3Client client = new Service3Client();
int a;
a = client.CheckSurveyExistAsync(this.Title.Text);
}
}
}
here is service code
public int CheckSurveyExist(string Title)
{
DataClasses2DataContext db2 = new DataClasses2DataContext();
DataClasses2DataContext db2 = new DataClasses2DataContext();
///IEnumerable<int> highScoresQuery3 =
int highScoreCount =
(from c in db2.Surveys
where c.SurveyTitle == Title select c).Count() ;
return highScoreCount;
}