her is the file

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();
            //VotingPanel2.ServiceReference1.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)
        {
        }


        void client_CheckSurveyExistCompleted(object sender, VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs e)
        {
            //int a;
            //a = e.Result;
           // if a

           MessageBox.Show(e.Result.ToString ());

            
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {

            Service3Client client = new Service3Client();
           // client.CheckSurveyExistCompleted += new EventHandler<VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs>(client_CheckSurveyExistCompleted);

            //client.CheckSurveyExistCompleted += new EventHandler<VotingPanel2.ServiceReference3.CheckSurveyExistCompletedEventArgs>(client_CheckSurveyExistCompleted);

            //client.CheckSurveyExistAsync(this.Title.Text,this.SurveyQuestion.Text,this.Surveyoption1.Text,this.Surveyoption2.Text,this.Surveyoption3.Text ); 



           
           // Service3Client client = new Service3Client();
           
           
           //client.CheckSurveyExistAsync(this.Title.Text);

            
        }

      

    }
}

and here is teh error

Error 1 The type or namespace name 'CheckSurveyExistCompletedEventArgs' does not exist in the namespace 'VotingPanel2.ServiceReference3' (are you missing an assembly reference?) C:\Users\Iram\Documents\Visual Studio 2008\Projects\VotingPanel2\VotingPanel2\CreateSurveyForm.xaml.cs 38 93 VotingPanel2

Recommended Answers

All 2 Replies

The error is saying that your "CheckSurveyExistCompletedEventArgs" class is not defined/exist in "VotingPanel2.ServiceReference3" namespace. You just need to follow the below steps :

1) Just make sure that "CheckSurveyExistCompletedEventArgs" class exist in the namespace.
2) remove the reference of "VotingPanel2.ServiceReference3" from your silverlight project.
3)Once again Build "VotingPanel2.ServiceReference3" project.
4) Now give reference again to your silverlight project.
5) build your entire project..

that's all..I belive once you follow above steps it will fix your error...

CheckSurveyExist is not teh calss but it is the method in service class

  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);
        }


    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.