here is my code:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim constr As String = ConfigurationManager.ConnectionStrings("oapConnectionString").ConnectionString
Using con As New SqlConnection(constr)
Dim sumQty As Integer = 0
For Each row As GridViewRow In GridView1.Rows
Dim quantity = Convert.ToInt32(DirectCast(row.FindControl("TextBox1"), TextBox).Text)
sumQty += quantity
Next
If sumQty < 100 Then
Using cmd As New SqlCommand("INSERT INTO [OAP].[dbo].[Beneficiary_max_limit]([District_Code],[Block_Code],[District_max_value])VALUES (@District_Code, @Block_Code, @District_max_value)")
cmd.CommandType = CommandType.Text
cmd.Connection = con
con.Open()
cmd. ...
Go to the complete details ...