.net - Set properties in the way it's declared in c# class -


i have class called "symbol" , have list of properties.

public class symbol {   z_prop{get;set;}   b_prop{get;set;}    a_prop{get;set;} } 

i have done db call , assign data reader class instance. below code

//dr datareader object symbol symbols = new symbol();                        symbols.z_prop= dr["z_prop"].tostring(); symbols.b_prop= dr["b_prop"].tostring(); symbols.a_prop= dr["a_prop"].tostring(); 

gridview output this:

   columns : a_prop  b_prop  z-prop    values  : value   value   value 

everything works fine. after assigning reader values, symbol properties ordered alphabetic order. want properties ordered declared in class. suggestion why it's ordered alphabetically?.

i think meant properties aligned in alphabetical order when see symbol class debugger window.if case can not how debugger works.

by default debugger show members in alphabetical order.

check below image:

enter image description here


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -