با سلام و تشکراز راهنمایی شما
من از کد زیر برای insert در بانک اطلاعاتی ام استفاده می کنم ولی خطا دارد و من متوجه آن خطا نمی شوم :
Dim gr As GridViewRow
Dim strIDs As String = ""
Dim boolCheck As Boolean = False
For Each gr In g1.Rows
Dim chk As CheckBox = CType(gr.FindControl("checkbox1"), CheckBox)
'If Not chk Is Nothing Then Response.Write(e.ToString)
If chk.Checked = True Then
boolCheck = True
cnn = New SqlConnection("Data Source=17693-2248-MAZA;Initial Catalog=AMOZESH;Integrated Security=True")
cnn.Open()
strsql = "insert into sabt861("elam") values ('" boolchecked.ToString "'")"
Dim cmd As New SqlClient.SqlCommand(strsql, cnn)
dr = cmd.ExecuteReader
g1.DataSource = dr
g1.DataBind()
cnn.Close()
End If
Next