shobhit007
New Member
Ok I'm trying to update a dataset where each piece of data has a different type. What I'd like to do is this:<BR><BR>For i = 1 to 5<BR> dataRow(i) = Ctype(Request.form(source(i).columnName), source(i).getType)<BR>Next<BR><BR>Of course that's not exact, but the point is I'm getting an error essentially saying that I have to hard code a System.Type for Ctype to use. That doesn't work at all since one might be a string, another an int, etc. So how the heck do I feed Ctype a dynamic type? For that matter, I'd take any other way of properly formatting a string to a dynamically specified data type.You could use a switch statement inside your for loop that was switched on the type of source. Just a thoughtYeah that's a pretty good idea. Seems like there should be a more elegant solution, but for lack of time I might have to go that route.