Click here to Skip to main content
15,905,229 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have created a class and trying to use the get and set method.
I get an error stating as follows:

"The type or namespace name 'get' could not be found are you missing a using directive or an assembly reference "?

I am developing the application using WPF 2010.

Please anyone suggest me what has to be done?
code:
using System;
using System.Collections.Generic;
using System.Linq;

using System.Text;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Windows;
namespace ImageUpload1
{

class Connect:INotifyPropertyChanged
{
private string _Patientid;


public string Patientid;
{
get
{
return _Patientid;
}
set
{
_Patientid = value;
OnPropertyChanged("Patientid");
}
}
private string _name;
public string name;
{
get
{
return _name;
}
set
{

_name = value;
OnPropertyChanged("name");
}
}
}
}


Thanks
Sophia
Posted
Updated 27-Nov-12 20:10pm
v2
Comments
[no name] 28-Nov-12 1:39am    
Show your code...
Sophia Ranjani Elango 28-Nov-12 1:55am    
using System;
using System.Collections.Generic;
using System.Linq;

using System.Text;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Windows;
namespace ImageUpload1
{

class Connect:INotifyPropertyChanged
{
private string _Patientid;


public string Patientid;
{
get
{
return _Patientid;
}
set
{
_Patientid = value;
OnPropertyChanged("Patientid");
}
}
private string _name;
public string name;
{
get
{
return _name;
}
set
{

_name = value;
OnPropertyChanged("name");
}
}
}
}
[no name] 28-Nov-12 2:06am    
copy this code on your question using widget "improve Question".. No able to get this perfectly so..

1 solution

It's pretty simple: semicolon is a statement terminator.
C#
public string Patientid;
   {
   get
      {
      return _Patientid;
      }
   set
      {
      _Patientid = value;
      OnPropertyChanged("Patientid");
      }
   }
If you get rid of the ";" after the Patientid, it will compile:
C#
public string Patientid
   {
   get
      {
      return _Patientid;
      }
   set
      {
      _Patientid = value;
      OnPropertyChanged("Patientid");
      }
   }

You will need to do this for all your properties.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900