For Each dr1 As DataRow In DataTables("GL_Budget_Definition").DataRows
For m As Integer = 1 To 12
Dim dr As DataRow = DataTables("HZH_GL_ALL_BUDGET").AddNew
Select Case m
Case 1
dr("BUDGET_NO") = dr1("Budget_no")
dr("DESCRIPTION") = dr1("Description")
dr("DEPT") = dr1("Dept")
dr("YEAR") = dr1("Year")
dr("VERSION") = dr1("Version")
dr("MONTH") = "Jan" ’其它都一样就这两句不同的
dr("AMONTS") = dr1("Jan")
Case 2
dr("BUDGET_NO") = dr1("Budget_no")
dr("DESCRIPTION") = dr1("Description")
dr("DEPT") = dr1("Dept")
dr("YEAR") = dr1("Year")
dr("VERSION") = dr1("Version")
dr("MONTH") = "Feb"
dr("AMONTS") = dr1("Feb")
Case 3
dr("BUDGET_NO") = dr1("Budget_no")
dr("DESCRIPTION") = dr1("Description")
dr("DEPT") = dr1("Dept")
dr("YEAR") = dr1("Year")
dr("VERSION") = dr1("Version")
dr("MONTH") = "Mar"
dr("AMONTS") = dr1("Mar")
Case 4
dr("BUDGET_NO") = dr1("Budget_no")
dr("DESCRIPTION") = dr1("Description")
dr("DEPT") = dr1("Dept")
dr("YEAR") = dr1("Year")
dr("VERSION") = dr1("Version")
dr("MONTH") = "Apr"
dr("AMONTS") = dr1("Apr")
Case 5
dr("BUDGET_NO") = dr1("Budget_no")
dr("DESCRIPTION") = dr1("Description")
dr("DEPT") = dr1("Dept")
dr("YEAR") = dr1("Year")
dr("VERSION") = dr1("Version")
dr("MONTH") = "May"
dr("AMONTS") = dr1("May")
Case 6
dr("BUDGET_NO") = dr1("Budget_no")
dr("DESCRIPTION") = dr1("Description")
dr("DEPT") = dr1("Dept")
dr("YEAR") = dr1("Year")
dr("VERSION") = dr1("Version")
dr("MONTH") = "Jun"
dr("AMONTS") = dr1("Jun")
Case 7
dr("BUDGET_NO") = dr1("Budget_no")
dr("DESCRIPTION") = dr1("Description")
dr("DEPT") = dr1("Dept")
dr("YEAR") = dr1("Year")
dr("VERSION") = dr1("Version")
dr("MONTH") = "Jul"
dr("AMONTS") = dr1("Jul")
Case 8
dr("BUDGET_NO") = dr1("Budget_no")
dr("DESCRIPTION") = dr1("Description")
dr("DEPT") = dr1("Dept")
dr("YEAR") = dr1("Year")
dr("VERSION") = dr1("Version")
dr("MONTH") = "Aug"
dr("AMONTS") = dr1("Aug")
Case 9
dr("BUDGET_NO") = dr1("Budget_no")
dr("DESCRIPTION") = dr1("Description")
dr("DEPT") = dr1("Dept")
dr("YEAR") = dr1("Year")
dr("VERSION") = dr1("Version")
dr("MONTH") = "Sep"
dr("AMONTS") = dr1("Sep")
Case 10
dr("BUDGET_NO") = dr1("Budget_no")
dr("DESCRIPTION") = dr1("Description")
dr("DEPT") = dr1("Dept")
dr("YEAR") = dr1("Year")
dr("VERSION") = dr1("Version")
dr("MONTH") = "Oct"
dr("AMONTS") = dr1("Oct")
Case 11
dr("BUDGET_NO") = dr1("Budget_no")
dr("DESCRIPTION") = dr1("Description")
dr("DEPT") = dr1("Dept")
dr("YEAR") = dr1("Year")
dr("VERSION") = dr1("Version")
dr("MONTH") = "Nov"
dr("AMONTS") = dr1("Nov")
Case 12
dr("BUDGET_NO") = dr1("Budget_no")
dr("DESCRIPTION") = dr1("Description")
dr("DEPT") = dr1("Dept")
dr("YEAR") = dr1("Year")
dr("VERSION") = dr1("Version")
dr("MONTH") = "Dec"
dr("AMONTS") = dr1("Dec")
End Select
DataTables("HZH_GL_ALL_BUDGET").Load '因为我是oracle数据库,用触发器做的主键ID,没插入一行才能触发一次ID,不然会报错,所以要加这一句同步的代码才行,感觉插入了900行要4秒钟,请问是否有高级的方法,可以价快速的?
Next
Next