dim s() as string
創(chuàng)新互聯(lián)公司是一家集網(wǎng)站建設(shè),芝罘企業(yè)網(wǎng)站建設(shè),芝罘品牌網(wǎng)站建設(shè),網(wǎng)站定制,芝罘網(wǎng)站建設(shè)報價,網(wǎng)絡(luò)營銷,網(wǎng)絡(luò)優(yōu)化,芝罘網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強企業(yè)競爭力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時我們時刻保持專業(yè)、時尚、前沿,時刻以成就客戶成長自我,堅持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實用型網(wǎng)站。
For Each fm1 In Panel1.Controls
dim i=0
if fm1.GetType.ToString = "System.Windows.Forms.TextBox" Then
s(i)=fm1.text
i+=1
End If
Next
首先打開數(shù)據(jù)源,然后使用alter table語句即可,具體范例如下:
Set cn = New ADODB.ConnectionSet rs = New ADODB.Recordsetconstr = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" 數(shù)據(jù)庫路徑及文件名 ""cn.Open constrDim str As Stringstr = "alter table 表名 add 字段 類型"rs.Open str, cn, adOpenStaticmsgbox"添加字段成功",vbokonly
Dim abc(2) As Integer
abc = {0, 1, 2}
'或者
Dim abcd() As Integer
ReDim abcd(9)
For i As Integer = 0 To abcd.Length - 1
abcd(i) = i
Next
也可聲明為字符串?dāng)?shù)組
for i =0 to ...
for j =0 to ...
keyarray(i,j)=
next
next
雙重循環(huán),賦值和讀取一樣
參照VB6,在VB.net應(yīng)該也差不多
方法一,讓它們形成控件數(shù)組
for i=1 to 5
textbox(i).text=1
next i
方法二,假設(shè)這些控件的名稱有規(guī)律,分別是textbox1,textbox2等
for i=1 to 5
controls("textbox" i ).text=1
next i
在VB6中能通過,希望對你有幫助
把“...”替換成你要初始化的數(shù)據(jù)。一個簡單的例子: Dim a(3) As Integer = { 0, 1, 2 }**修改**既然有界數(shù)組不能初始化,就還缺(?。┙鐢?shù)組試試嘛: Dim a() As Integer = { 0, 1, 2 } 類型不匹配的錯誤估計是你的結(jié)構(gòu)體缺少構(gòu)造函數(shù)造成的。在你的quality_i結(jié)構(gòu)體定義里面加一個構(gòu)造函數(shù),如下所示 Public Structure quality_i Public nub As Integer Public nae As String Public Sub New(ub As Integer, ae As String)nub = ubnae = aeEnd SubEnd Structure 然后以如下方式初始化: Dim k() As quality_i = {