SIVA

SIVA

  • NA
  • 742
  • 706.3k

Object parameters sorted in Ascending Order

Dec 20 2012 2:50 PM
Dear all,

I have public class with its parameters like 

public class Student
{
   public int No{get; Set;}
   public string Name{get; set;}
   public date DOJ{get; set;}
   public string Address{get; set;}
}

Now, In my code behind window i created object for Student class and i assigned values, which i got from my front end like

Student objStudent=new Student();
objStudent.No=txtNo.text;
objStudent.Name=txtName.text;
objStudent.DOJ=txtDOJ.text;
objStudent.Address=txtAddress.text;


While passing this student object to my InsertDetails method its going as sorted way based on its parameters like

Address
DOJ
Name
No

In my code I am passing student object as a parameter to my Stored Procedure. So I am getting error that parameter mismatch.

Here I am not getting the reason that why the parametes get sorted while passing.

It should be in proper way that how i defined like No, Name, DOJ, Address

Can Somebody let me know what will be the issue?