dim i=MyCommand.ExecuteNonQuery()
 if i>0 then
  response.write("ok")
else
  response.wiret("false")
end if

解决方案 »

  1.   

    Try
                Dim StrSql As String            StrSql = "insert  TCS_account_name(u_account) values('" & new_user.Text & "') "
                Dim conn As SqlClient.SqlConnection = New SqlClient.SqlConnection(conn_str)
                Dim my_sqlcommand As SqlClient.SqlCommand = New SqlClient.SqlCommand(StrSql)
                conn.Open()
                my_sqlcommand.Connection = conn
                Dim a As Int16 = my_sqlcommand.ExecuteNonQuery()
                conn.Close()
                If a = 1 Then
                    Response.Write("<script language='javascript'> alert('增加成功 !  ');</script>")
                End If
      

  2.   

    将Trusted_Connection=yes改为uid=sa;pwd=****的方式试一下。
      

  3.   

    建议将以下语句写入服务器端
    <script language="VB" runat="server">
    ...
    <script>再将InsertCmd语句跟踪出来,在后台运行,看报什么错。