0

How can I stop this error, here is my code and there error occurs where i have decimal.TryParse(....

 class EstCalc
 { 
    static  void Variables (string[] args)
    {

                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);

Edited by mike_2000_17: Fixed formatting

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by Rashakil Fol
0

What kind of error do you get?
Throwing code and saying "error" does not help very much.
decimal.TryParse works fine when I use it.

0

I was stated in the title "object reference required for nonstatic field.

0

You are right, but I can't infer from your code sample where the error is, because it is incomplete. And if possible please use code tags.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.