示例#1
0
 private void listBox1_Click(object sender, EventArgs e)
 {
     WindowsNoteClient.ServiceReference1.NoteServiceClient proxy =
         new WindowsNoteClient.ServiceReference1.NoteServiceClient("BasicHttpBinding_INoteService");
     WindowsNoteClient.ServiceReference1.Note note = proxy.Getnote(int.Parse(listBox1.SelectedValue.ToString()));
     label5.Text = note.NoteId.ToString();
     label6.Text = note.NoteTitle;
     label7.Text = note.NoteContent;
     proxy.Close();
 }
示例#2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            WindowsNoteClient.ServiceReference1.NoteServiceClient proxy =
                new WindowsNoteClient.ServiceReference1.NoteServiceClient("BasicHttpBinding_INoteService");
            DataSet ds = proxy.GetNotes();

            listBox1.DataSource    = ds.Tables[0].DefaultView;
            listBox1.DisplayMember = "NoteTitle";
            listBox1.ValueMember   = "NoteId";
            label5.Text            = "temp";
            label6.Text            = "temp";
            label7.Text            = "temp";
            proxy.Close();
        }