求助急:请问高手(我这段代码错在哪里了?)
<SCRIPT language=vb runat="server">public sub page_load(obj as object,e as eventargs)
call con()
dim sql,stu as string
sql="select * from student"
dim mycomm as new sqlcommand(sql,myconn)
dim dr as sqldatareader=mycomm.executereader()
if dr.read() then
Dim i,k As Integer
For i = 0 To k
'stu_sex是个dropdownlist 控件,dr("stu_sex")是从数据库中取的值
If stu_sex.Items.Item(i).Text = dr("stu_sex") Then
stu_sex.Items.Item(i).Selected = True
else
stu_sex.Items.Item(i).Selected = false
End If
i=i+1
Next
end if
end sub