here is code:
Using con As New SqlConnection(constr)
' Build a command to execute your query '
Using com As New SqlCommand(query1, con)
' Open your connection '
con.Open()
' Add your parameter '
com.Parameters.AddWithValue("@Scheme1", Scheme1.SelectedValue)
' Define your sum (from your query) '
Dim querySum = Convert.ToDouble(com.ExecuteScalar())
con.Close()
' Sum up your values '
Dim sumQty As Integer = 0
For Each row As GridViewRow In GridView2.Rows
Dim quantity = Convert.ToInt32(DirectCast(row.FindControl("TextBox1"), TextBox).Text)
sumQty += quantity
actually prblm is that textbox is indie gridview. so when we write ...
Go to the complete details ...