Hi-I am getting a run time error when I run this .aspx form only on the intranet. When run locally, it runs ok. It does not do a lot yet. Can someone take a look at it and see if there is anything wrong that may be causing the application run time error? It appears to have started after I added the variables to represent the text box to pass to the value in sql insert.
thanks
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<Script Runat="Server">
Sub Button_Click(s as Object, e as EventArgs)
Dim conPACESurvey as SQLConnection
Dim strInsert as String
Dim cmdInsert as SqlCommand
conPACESurvey = New SqlConnection("Server=xxx;UID=xx;PWD=xx; database=xxxxxx")
strInsert = "Insert Participant (surveyyear,entrydate,returneddate) Values('2007',GetDate(),@ReturnedDate)"
cmdInsert = New SqlCommand( strInsert, conPACESurvey )
cmdInsert.Parameters.AddWithValue("@ReturnedDate", Freturneddate.Text)
conPACESurvey.Open()
cmdInsert. ExecuteNonQuery ()
conPACESurvey. Close()
End Sub
</Script>
<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Participant Survey</title>
</head>
<body>
<form Runat = "Server">
<asp:Label ID="Label2" runat="server" Text="PACE CNY PARTICIPANT SURVEY" Width="424px"></asp:Label><br />
<br />
<asp:Label ID="Label1" runat="server" Text="Survey Returned Date" Width="147px"></asp:Label>
<asp:TextBox ID="Freturneddate" runat="server" Style="border-right: blue thin solid;
border-top: blue thin solid; border-left: blue thin solid; border-bottom: blue thin solid"></asp:TextBox><br />
<br />
<asp:Button ID="SubmitButton" Height="58px" Text="Submit Survey" OnClick="Button_Click" Runat="Server" Width="98px"/>
</form>
</body>
</html>
thanks
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<Script Runat="Server">
Sub Button_Click(s as Object, e as EventArgs)
Dim conPACESurvey as SQLConnection
Dim strInsert as String
Dim cmdInsert as SqlCommand
conPACESurvey = New SqlConnection("Server=xxx;UID=xx;PWD=xx; database=xxxxxx")
strInsert = "Insert Participant (surveyyear,entrydate,returneddate) Values('2007',GetDate(),@ReturnedDate)"
cmdInsert = New SqlCommand( strInsert, conPACESurvey )
cmdInsert.Parameters.AddWithValue("@ReturnedDate", Freturneddate.Text)
conPACESurvey.Open()
cmdInsert. ExecuteNonQuery ()
conPACESurvey. Close()
End Sub
</Script>
<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Participant Survey</title>
</head>
<body>
<form Runat = "Server">
<asp:Label ID="Label2" runat="server" Text="PACE CNY PARTICIPANT SURVEY" Width="424px"></asp:Label><br />
<br />
<asp:Label ID="Label1" runat="server" Text="Survey Returned Date" Width="147px"></asp:Label>
<asp:TextBox ID="Freturneddate" runat="server" Style="border-right: blue thin solid;
border-top: blue thin solid; border-left: blue thin solid; border-bottom: blue thin solid"></asp:TextBox><br />
<br />
<asp:Button ID="SubmitButton" Height="58px" Text="Submit Survey" OnClick="Button_Click" Runat="Server" Width="98px"/>
</form>
</body>
</html>