Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get length/count property of the Object datatype??

Status
Not open for further replies.

fletchsod

Programmer
Dec 16, 2002
181
Hi!

This script I'm using is a webservice. Upon retreiving the data, which is considered object, not Int32, string, Double, etc. So, In VB.NET, I can do this...

Code:
Object oManheim_VehiclesAsObject = New Object()
Int32 iTotalCount = 0

iTotalCount = oManheim_VehiclesAsObject.Length

But how do you that in C#? The Object doesn't have a length in C#.

Code:
Int32 iTotalCount = 0;
object oManheim_VehiclesAsObject = new object();

iTotalCount = oManheim_VehiclesAsObject.????? ;

I don't have a lot of control over the company's webservice which defined it as object which may works as a multiple-dimensional array of some sort.

Thanks...
 
Code:
object o = 1;
int x;
x = (int)o;
x = o as int;
x = Convert.ToInt32(o);

string s = 2.ToString();
x = int.Parse(s);
bool b = int.TryParse(s, out x);

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top