Click here to Skip to main content
15,888,816 members
Home / Discussions / C#
   

C#

 
GeneralRe: string is not recognized Pin
Ashfield24-Sep-09 1:23
Ashfield24-Sep-09 1:23 
GeneralRe: string is not recognized Pin
Rabia_Arif24-Sep-09 5:19
Rabia_Arif24-Sep-09 5:19 
QuestionFileSystemWatcher and Window Service. Pin
Escocia23-Sep-09 6:43
Escocia23-Sep-09 6:43 
AnswerRe: FileSystemWatcher and Window Service. Pin
0x3c023-Sep-09 6:55
0x3c023-Sep-09 6:55 
AnswerRe: FileSystemWatcher and Window Service. Pin
Luc Pattyn23-Sep-09 8:25
sitebuilderLuc Pattyn23-Sep-09 8:25 
GeneralRe: FileSystemWatcher and Window Service. Pin
Escocia24-Sep-09 0:59
Escocia24-Sep-09 0:59 
GeneralRe: FileSystemWatcher and Window Service. Pin
Luc Pattyn24-Sep-09 1:11
sitebuilderLuc Pattyn24-Sep-09 1:11 
QuestionData from Scanner to Database Pin
Dambod23-Sep-09 6:40
Dambod23-Sep-09 6:40 
AnswerRe: Data from Scanner to Database Pin
Manas Bhardwaj23-Sep-09 6:51
professionalManas Bhardwaj23-Sep-09 6:51 
GeneralRe: Data from Scanner to Database Pin
Dambod23-Sep-09 6:57
Dambod23-Sep-09 6:57 
GeneralRe: Data from Scanner to Database Pin
Dave Kreskowiak23-Sep-09 9:31
mveDave Kreskowiak23-Sep-09 9:31 
AnswerRe: Data from Scanner to Database Pin
Henry Minute23-Sep-09 6:58
Henry Minute23-Sep-09 6:58 
GeneralRe: Data from Scanner to Database Pin
Dambod23-Sep-09 7:17
Dambod23-Sep-09 7:17 
GeneralRe: Data from Scanner to Database Pin
Henry Minute23-Sep-09 8:31
Henry Minute23-Sep-09 8:31 
AnswerRe: Data from Scanner to Database Pin
cmk23-Sep-09 8:29
cmk23-Sep-09 8:29 
QuestionExcel Chart Secondary Axis Pin
Cwenee23-Sep-09 5:29
Cwenee23-Sep-09 5:29 
AnswerRe: Excel Chart Secondary Axis Pin
Qu Dong2-Sep-13 23:11
Qu Dong2-Sep-13 23:11 
QuestionXMLSerialization Pin
ahmedsamir23-Sep-09 3:21
ahmedsamir23-Sep-09 3:21 
Hi i have an error in the Deserialize operation can you help me to solve it.

// my employee class
  public class Employee
    {
        int id;
        string name;

        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public void Show()
        {
            Console.WriteLine("Employee ID is " + Id);
            Console.WriteLine("Employee name is " + Name);
        }
    }

// the Serialize
static void Main(string[] args)
        {
           
           Employee[] emp = new Employee[3];

            emp[0] = new Employee();
            emp[0].Id = 10;
            emp[0].Name = "x";

            emp[1] = new Employee();
            emp[1].Id = 20;
            emp[1].Name = "y";

            emp[2] = new Employee();
            emp[2].Id = 30;
            emp[2].Name = "x";

            FileStream fs = new FileStream("123.txt", FileMode.Create);

            XmlSerializer xs = new XmlSerializer(typeof(Employee[]));
            xs.Serialize(fs, emp);

            fs.Close();
        }

// the Deserialize
 static void Main(string[] args)
        {
           
            Employee[] emp = new Employee[3];

            FileStream fs = new FileStream("123.txt", FileMode.Open);
            XmlSerializer[] xs = new XmlSerializer[3];

            for (int i = 0; i < emp.Length; i++)
            {
                xs[i] = new XmlSerializer(typeof(Employee));
                emp[i] = new Employee();
                emp[i] = (Employee)xs[i].Deserialize(fs);
                emp[i].Show();
            }
}

AnswerRe: XMLSerialization Pin
stancrm23-Sep-09 3:40
stancrm23-Sep-09 3:40 
AnswerRe: XMLSerialization Pin
ahmedsamir23-Sep-09 13:07
ahmedsamir23-Sep-09 13:07 
QuestionDelete A and Prt Records from DNS Pin
caiena23-Sep-09 3:09
caiena23-Sep-09 3:09 
AnswerRe: Delete A and Prt Records from DNS Pin
Richard MacCutchan23-Sep-09 3:49
mveRichard MacCutchan23-Sep-09 3:49 
GeneralRe: Delete A and Prt Records from DNS Pin
caiena23-Sep-09 3:54
caiena23-Sep-09 3:54 
QuestionHow to make textbox mandatory on dropdown change Pin
NK723-Sep-09 2:57
NK723-Sep-09 2:57 
AnswerRe: How to make textbox mandatory on dropdown change Pin
Richard MacCutchan23-Sep-09 3:04
mveRichard MacCutchan23-Sep-09 3:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.