大侠提出strids后,运行时myadapter3.Fill(myds3)这句提示')'附近有语法异常.这是哪里的异常呢
大侠提出strids后,运行时myadapter3.Fill(myds3)这句提示')'附近有语法错误.这是哪里的错误呢?
private strids as string="";
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
'dim strids as string=" " 这句移到外面
Dim total_topic_num As Integer = 12
Dim test_topic_num As Integer = 5
Dim interval As Integer = total_topic_num \ test_topic_num
Dim big_interval_num As Integer = total_topic_num Mod test_topic_num
Dim array_topic_id(test_topic_num) As Integer
Dim i As Integer = 0
If big_interval_num <> 0 Then
For i = 0 To test_topic_num - 1 - big_interval_num
Randomize()
array_topic_id(i) = Int(interval * Rnd() + i * interval)
strids = strids & array_topic_id(i) & ","
Next
For i = test_topic_num - big_interval_num To test_topic_num - 1
Randomize()
array_topic_id(i) = (test_topic_num - big_interval_num) * interval + Int((interval + 1) * Rnd() + (i - (test_topic_num - big_interval_num)) * (interval + 1))
strids = strids & array_topic_id(i) & ","
Next
private strids as string="";
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
'dim strids as string=" " 这句移到外面
Dim total_topic_num As Integer = 12
Dim test_topic_num As Integer = 5
Dim interval As Integer = total_topic_num \ test_topic_num
Dim big_interval_num As Integer = total_topic_num Mod test_topic_num
Dim array_topic_id(test_topic_num) As Integer
Dim i As Integer = 0
If big_interval_num <> 0 Then
For i = 0 To test_topic_num - 1 - big_interval_num
Randomize()
array_topic_id(i) = Int(interval * Rnd() + i * interval)
strids = strids & array_topic_id(i) & ","
Next
For i = test_topic_num - big_interval_num To test_topic_num - 1
Randomize()
array_topic_id(i) = (test_topic_num - big_interval_num) * interval + Int((interval + 1) * Rnd() + (i - (test_topic_num - big_interval_num)) * (interval + 1))
strids = strids & array_topic_id(i) & ","
Next