我有一個gridview,我在check_changed
上插入複選框,即使我編寫以下代碼以獲取問題Id的值,如圖中所示,也顯示了文本框中的值,但是當我使用這些串中的SQL:在asp.net中將字符串轉換爲整數
Select * from IssueBook Where IssueId IN (values)
它顯示誤差變換VARCHAR到數字上check_changed
我寫這些代碼我有采取IssueId(數字)
Protected Sub CheckBox1_CheckedChanged1(ByVal sender As Object, ByVal e As System.EventArgs)
Dim x As String = ""
For Each row As GridViewRow In GridView1.Rows
Dim cb As CheckBox = row.FindControl("checkbox1")
If cb IsNot Nothing AndAlso cb.Checked Then
If x <> "" Then
x += ","
End If
x += row.Cells(1).Text
End If
Next
RwId.Text = x
Session("SelctdIsuedBokNo") = RwId.Text
在我以前的數值數據表。 如何使用逗號分隔符將以上代碼轉換爲整數,例如4,5,6,
?
您的代碼對於SQL查詢來說究竟是什麼樣子,以及發生錯誤的確切位置?我不認爲這是所有的代碼。 – LittleBobbyTables