VS 2008
Just guessing here, but have you tried:
Here is my class:
Here is the calling code: (WinForm)Code:using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WindowsFormsApplication1 { class clsProductType { private int sortorder; public clsProductType() { // sortorder = null; <<--- this won't compile for me } public int SortOrder { get { return sortorder; } set { sortorder = value; } } } }
Does this help you?Code:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button2_Click(object sender, EventArgs e) { clsProductType ProductType = new clsProductType(); ProductType.SortOrder = System.Convert.ToInt32(this.textBox1.Text); MessageBox.Show("SortOrder = " + ProductType.SortOrder); } }
robert




Reply With Quote