Im a newby and im getting the following error in my code:
An object reference is required for the nonstatic field,method,or property 'EstimatorC.Estimate.quantityTB'
Can anyone help me on this. The code is below. Thanks in advance.
class Calculator
{
static void Method1(string[] arg)
{
//miscellaneous varibles
decimal bl; //blank length
decimal bw; //blank width
decimal bp; //blank perifery
decimal pd; //part depth
decimal dq; //die quantity
decimal.TryParse(quantityTB.Text, out dq);
decimal dl; //die length
decimal dw; //die width
decimal ds; //die shut height
decimal d; //density
decimal.TryParse(densityTB.Text, out d);
decimal wp; //work percetage of die
decimal.TryParse(dieworkareapercentageTB.Text, out wp);
decimal trl; //trim length
decimal.TryParse(lengthoftrimTB.Text, out trl);
decimal cncc; //cnc complexity
decimal dodr; //degree of difficulty rating
decimal sec;
decimal.TryParse(diesectionsTB.Text, out sec);
decimal opqty;//number of operations
decimal.TryParse(noofopsTB.Text, out opqty);
}
}
An object reference is required for the nonstatic field,method,or property 'EstimatorC.Estimate.quantityTB'
Can anyone help me on this. The code is below. Thanks in advance.
class Calculator
{
static void Method1(string[] arg)
{
//miscellaneous varibles
decimal bl; //blank length
decimal bw; //blank width
decimal bp; //blank perifery
decimal pd; //part depth
decimal dq; //die quantity
decimal.TryParse(quantityTB.Text, out dq);
decimal dl; //die length
decimal dw; //die width
decimal ds; //die shut height
decimal d; //density
decimal.TryParse(densityTB.Text, out d);
decimal wp; //work percetage of die
decimal.TryParse(dieworkareapercentageTB.Text, out wp);
decimal trl; //trim length
decimal.TryParse(lengthoftrimTB.Text, out trl);
decimal cncc; //cnc complexity
decimal dodr; //degree of difficulty rating
decimal sec;
decimal.TryParse(diesectionsTB.Text, out sec);
decimal opqty;//number of operations
decimal.TryParse(noofopsTB.Text, out opqty);
}
}