What is the problem?
It seems like you want to maintain then sequence number after deleting the rows in the middle using:
While j <= Val(a(x))
Dim temp As Integer
temp = Val(a(x))
Call openconnection()
str = "update Assets_Detail set No=No-1 where No > " & temp & ""
cmd = New SqlCommand(str, cn)
cmd.ExecuteNonQuery()
cn.Close()
j = j + 1
End While
And that is not working.
If this is the case then:
You have to sort the values in a() in descending order and then loop through a() and use your update query.
BTW, normally use a number as primary key, and don't bother about the items being deleted.