Go through it with a fine tooth comb and keep checking Here's an error I overlooked, the checkbox is boolean true or false, so it wrote an bit to the parameter of 0 or 1 Or perhaps it's a dropdown list since you used selected value.
.Add("@DistrictId", SqlDbType.TinyInt).Value = CheckBoxList1.SelectedValue
That's a lot data to insert all at once. You know that data writes and updates take longer to perform on the SQL server, in terms of time. And then you called a stored procedure after that. You have an error somewhere. finding the error is easier if your code is more organized. Maybe instead of so many partial writes, you gather all your data first, and package it up in a class, structure or model, and then do 1 write to the database. You just pass the class or structure to the database function, and do the write. On multiple records, you just loop the database write function. https://msdn.microsoft.com/en-us/library/aa289521%28v=vs.71%29.aspx[^] http://www.functionx.com/visualbasic/Lesson19.htm[^] In a seperate file
Public Structure structure_accountInfo
Public m_firstName as string
Public m_lastName as string
End Structure
In a seperate file
Public Shared Function account_db_update(ByVal sAI as structure_accountInfo) as Integer
Dim dwExitCode As Integer = 2
Dim connStr As String = ConfigurationManager.ConnectionStrings("DefaultConnection").ConnectionString
Dim conn As New SqlConnection(connStr)
Dim query as string = \_
"UPDATE TABLE " & \_
" SET " & \_
" firstName = @firstName " & \_
", lastName = @lastName " & \_
" WHERE ID = @ID "
Dim cmd As New SqlCommand(query, conn)
Dim param\_\_FirstName As SqlParameter
param\_\_FirstName = New SqlParameter("@FirstName", SqlDbType.VarChar, 80)
param\_\_FirstName.Value = sAI.m\_firstName
cmd.Parameters.Add(param\_\_FirstName)
Dim param\_\_LastName As SqlParameter
param\_\_LastName = New SqlParameter("@LastName", SqlDbType.VarChar, 80)
param\_\_LastName.Value = sAI.m\_lastName
cmd.Parameters.Add(param\_\_LastName)
Try
conn.Open()
cmd.ExecuteNon