C# WCF将数据插入我的SQL

C# WCF将数据插入我的SQL,c#,wcf,windows-phone-7,C#,Wcf,Windows Phone 7,我正在尝试通过WCF将数据从Windows phone插入sql server。 我必须按照这个例子来编辑我的项目。。 但是数据没有插入到我的数据库中。 我的编码如下: 放在WindowPhone MainPage.xaml.cs下 private void button1_Click(object sender, RoutedEventArgs e) { //Insert textbox1.text into database s

我正在尝试通过WCF将数据从Windows phone插入sql server。 我必须按照这个例子来编辑我的项目。。 但是数据没有插入到我的数据库中。 我的编码如下:

放在WindowPhone MainPage.xaml.cs下

private void button1_Click(object sender, RoutedEventArgs e)
        {
            //Insert textbox1.text into database
            string empId = textBox1.Text;
            Service1Client proxy = new Service1Client();
            proxy.AddEmployeeCompleted += new EventHandler<AddEmployeeCompletedEventArgs>(proxy_AddEmployeeCompleted);
            proxy.AddEmployeeAsync(empId);
            MessageBox.Show(textBox1.Text);
        }


private void proxy_AddEmployeeCompleted(object sender, AddEmployeeCompletedEventArgs e)
    {
        bool bb = Convert.ToBoolean(e.Result);
        MessageBox.Show(textBox1.Text);
        if (bb == true)
        {
            MessageBox.Show("Record Added Successfully !!");
        }
        else
        {
            MessageBox.Show("Unable to Insert record,Try Again !!");
        }
    }
以及IService1.cs上的代码

namespace MyService
{

    [ServiceContract]

    public interface IService1
    {
        [OperationContract]

        bool AddEmployee(string empId);
    }
}

我的编码有问题吗?

您是否检查过服务器端的代码是否已到达?如何检查?我按照此链接插入数据。但是我不理解解决方案。我假设您拥有服务器端服务定义的代码。在服务定义代码的入口点上设置一个断点,看看它是否中断以及接下来会发生什么(异常或其他情况)。它表明请求的注册表访问是不允许的。这意味着什么?我怎么知道?我认为您应该向我们展示此事务中涉及的全部代码,以及异常的类型/消息/堆栈跟踪(如果有)。
namespace MyService
{

    [ServiceContract]

    public interface IService1
    {
        [OperationContract]

        bool AddEmployee(string empId);
    }
}