码迷,mamicode.com
首页 > 编程语言 > 详细

数组和ArrayList 相互转换

时间:2015-07-21 12:25:15      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:

Dim params(10) As DbParameter 

params(0) = DBHelper.CreateDbParameter("@RegName", Jz_RegInfo.RegName)
params(1) = DBHelper.CreateDbParameter("@RegAddress", Jz_RegInfo.RegAddress)
params(2) = DBHelper.CreateDbParameter("@RegCode", Jz_RegInfo.RegCode)
params(3) = DBHelper.CreateDbParameter("@CutOFFDate", Jz_RegInfo.CutOFFDate)
params(4) = DBHelper.CreateDbParameter("@IsZhengShi", Jz_RegInfo.IsZhengShi)
params(5) = DBHelper.CreateDbParameter("@RegDateTime", Jz_RegInfo.RegDateTime)
params(6) = DBHelper.CreateDbParameter("@ClientID", Jz_RegInfo.ClientID)
params(7) = DBHelper.CreateDbParameter("@Xian", Jz_RegInfo.Xian)
params(8) = DBHelper.CreateDbParameter("@Shi", Jz_RegInfo.Shi)
params(9) = DBHelper.CreateDbParameter("@IsDeleted", Jz_RegInfo.IsDeleted)
params(10) = DBHelper.CreateDbParameter("@Remark", Jz_RegInfo.Remark)

Dim arrayPara As New ArrayList()  
arrayPara.AddRange(params)

 

ArrayList 转换为数组的方法:

数组  as  类型()  =ArrayList.ToArray (GetType(类型))

Dim arr As DbParameter() = arrayPara.ToArray(GetType(DbParameter))
 Dim Array  As DbParameter() = DirectCast(arrayPara.ToArray(GetType(DbParameter)), DbParameter())

数组和ArrayList 相互转换

标签:

原文地址:http://www.cnblogs.com/Orangeorchard/p/4663944.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!