Try............. Catch Exp As SqlException
            '添加時,如果存在相同的主鍵
            If Exp.Number = 2627 Then
                lblMsg.Text = "<font color=red>錯誤:已存在相同的名稱!</font>"
              End If
finally
conn.close
        End Try