c# - alternate method of datatable to get the value instead of using tostring() -
I want to get the column value of the datamat in a string type variable, I am using this code.
objdt.Rows [i] ["mr_mdi_meter_status_3"] toString () .; Someone has told me that do not use the tostring () method, it will convert every value into a string. That's right! But what is another way to get value from a dataset call?
You can change the value directly to the type of class you want to use to convert For that object, you have an integer column in which you can directly use and pass the object to int. To do this, you do not need to convert the value using the toString method. int meterStatus = Convert.ToInt32 (objdt.Rows [i] ["mr_mdi_meter_status_3"]); Using the typing dataset is another possiblity, to understand the MSDN article to understand how the typed Dataset can be used.
Comments
Post a Comment