我想获取 的行数DataSet
,但这里的代码抛出异常
Dim con As New SqlConnection("server=localhost;database=MSDSS;Integrated Security=True")
Dim i As Integer
con.Open()
Dim qstr As String = "Select * From SJournal"
Dim sqladp As New SqlDataAdapter(qstr, con)
Dim dt As New DataSet
sqladp.Fill(dt, "SJ")
Dim j As Integer = dt.Tables("SJ").Rows.Count
For i = 0 To j Step 1
Dim rowname As String = dt.Tables("SJ").Rows(i)("JournalName")
Next
这是我计算字符串相似度的方法
Dim Kq As Double = 2
Dim Kr As Double = 1
Dim Ks As Double = 1
Dim ss() As Char = rowname.ToCharArray()
Dim st() As Char = journalname.ToCharArray()
Dim q As Integer = ss.Intersect(st).Count()
Dim s As Integer = ss.Length - q
Dim r As Integer = st.Length - q
Dim total As Double = (Kq * q) / (Kq * q + Kr * r + Ks * s)
请给我解决方案