Link to home
Start Free TrialLog in
Avatar of csharp_learner
csharp_learnerFlag for Singapore

asked on

Get INT from DataTable C#

Hi I have a DataTable if INT and strings.

When i retrive the string from the DataTable "TextBox1.Text = datatable.Rows[0][2].ToString();"
I have no problem, but when i want to retrive a INT from the datatable in the same way to a numberupdownBox "numericUpDown1.Value = ordt.Rows[0][7];" the error "Cannot implicitly convert type object to decimal kept blocking.

How can I solve this?
ASKER CERTIFIED SOLUTION
Avatar of Gautham Janardhan
Gautham Janardhan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Actually you will also need .ToString() after the [7] if it is going to be initially an object.