[求助]XML数据阅读器EXecuteXmlReader问题
Dim constr As StringDim mycon As SqlConnection
constr = "uid=sa;pwd=bxd;database=exercise;server=qx100"
Try
mycon = New SqlConnection(constr)
mycon.Open()
MsgBox("Sql Server测试成功")
Catch mye As Exception
MsgBox("Sql server测试失败" & mye.ToString)
End Try
Dim mycom As SqlCommand
Dim sqlstr As String
Dim myxr As System.Xml.XmlReader
sqlstr = "select * form t_info for XML AUTO"
mycom = New SqlCommand(sqlstr, mycon)
myxr = mycom.ExecuteXmlReader
While myxr.Read
TextBox1.Text = TextBox1.Text & myxr(0) & "," & myxr(1) & "," & myxr(2) & "," & myxr(3) & "," & myxr(4) & vbCrLf
End While
mycon.Close()
执行到 myxr = mycom.ExecuteXmlReader报错
大家帮忙看一下为什么报错