I kep receiving the error:
Line 1: Incorrect syntax near 'l'. Unclosed quotation mark before the character string ''.

But, I've looked over the code numerous times and do not seem to find this error. Here is the SQL part of the code. What i am trying to do take words that have been entered into the fields and add their respective ID numbers to the table. The page worked until I switched around the data types in the table to represent the ID numbers rather than the names. It seems that the portion of the code that it does not like is where it tries to execute the stored procedure. What could I be doing wrong? Does it have something to do with conflicting data types?

<%@ Page Language="VB" Debug="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SQLClient" %>
<script runat="server">

Dim connstr as string = "Server=localhost;UID=User;PWD=password;Database=E ndoscopy"
Dim return_page as string = "AT.aspx"

Sub Page_Load(sender As Object, e As EventArgs)
Dim sql as string
if not Page.IsPostBack then
sql = "select AccountID + ' - ' + AccountName as accnumber from Accounts"

FillDropDownList(sql,AccNumber)

end if
if not Page.IsPostBack then
sql = "select distinct territory from Territories"
FillDropDownList(sql,Fromname)

end if
if not Page.IsPostBack then
sql = "select distinct territory from Territories"
FillDropDownList(sql,Toname)

end if

End Sub

Sub FillDropDownList(sql as string, ddl as DropDownList)

' Create Connection Object, Command Object, Connect to the database
Dim conn as New SQLConnection(connstr)
Dim cmd as New SQLCommand(sql,conn)
conn.open()

' Execute the SQL, Bind the results to the Dropdown List Control
ddl.DataSource = cmd.ExecuteReader(CommandBehavior.CloseConnection)
ddl.DataBind()

End Sub

Sub InsertData()

Dim sql as string


sql = "insertaccounttransfer 'AccountNumber', 'FromTerritory', 'FromTM', 'FromRegion',

'FromDivision', 'ToTerritory', 'ToTM', 'ToRegion', 'ToDivision'"


sql = sql.replace("AccountNumber", AccNumber.SelectedItem.Value)
sql = sql.replace("FromTerritory", FromName.SelectedItem.Value)
sql = sql.replace("FromTM",FromID.Text)
sql = sql.replace("FromRegion", FromRegion.Text)
sql = sql.replace("FromDivision", FromDivision.Text)
sql = sql.replace("ToTerritory", toname.SelectedItem.Value)
sql = sql.replace("ToTM", ToID.Text)
sql = sql.replace("ToRegion", ToRegion.Text)
sql = sql.replace("ToDivision", ToDivision.Text)



Dim conn as New SQLConnection(connstr)
Dim cmd as New SQLCommand(sql,conn)
conn.open()


cmd.ExecuteNonQuery()
conn.Close()


Response.redirect(return_page)

end sub

Sub cmdInsert_Click(sender As Object, e As EventArgs)
InsertData()
End Sub




Sub cmdCancel_Click(sender As Object, e As EventArgs)
response.redirect(return_page)
End Sub

</script>