Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 19th, 2007, 11:28 AM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default I don't understand...

Hi guys,
I have a prob and I feel like a n00b! I have written/customised a code to input data from an html form (on a .net server) to an SQL database (on a separate SQL server.


I keep getting the following error

Active Server Pages error 'ASP 0221'

Invalid @ Command directive

/directinput.asp, line 1

The specified 'import Namespace="System.data" ' option is unknown or invalid.

I think this means that it can't find the namespace system.data; but I thought that it would be present as part of ASP.net servers basic program files...

I've included a copy of the script below...If anyone can help me I'd SO appreciate it!

Cheers fellas

Jim

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Sqlclient" %>
<%@ Import Namespace="System.Text"%>

<html>
<script language="VB" runat="server" >
   Dim MyConnection As SqlConnection

   Sub Page_Load(Src As Object, e As EventArgs)

      myConnection = New SqlConnection("server=213.171.193.1;" _
         & "catalog=MyTime;Trusted_Connection=Yes;User ID=jmsherry")

      If Not IsPostBack Then
         BindGrid()
      End If
   End Sub

   ' Implement an AddAuthor_Click function. This function does some data
   ' validation on the input form and builds a parameterized command containing
   ' all the fields of the input form. Then it executes this command to the
   ' database and tests (using the try command) whether the data was added.
   ' Finally, it rebinds the DataGrid to show the new data.

   Sub AddAuthor_Click(Sender As Object, e As EventArgs)
      Dim myCommand As SqlCommand
      Dim insertCmd As String
      ' Check that four of the input values are not empty. If any of them
      ' is empty, show a message to the user and rebind the DataGrid.
      If (FirstName.Value = "" Or Surname.Value = "" _
         Or PrimaryEmail.Value = "") Then
         Message.InnerHtml = "ERROR: Null values not allowed for " _
            & "Membership Type, First Name, Surname, Primary Email."
         Message.Style("color") = "red"
       Elseif (Annual.value = "" And Quarterly.value = "")Then
       Message.InnerHtml = "ERROR: You must select a memberhip type"
       Message.Style("color") = "red"
       Else (AcceptT&C.value = "")Then
       Message.InnerHtml = "ERROR:You must indicate that you accept the terms and conditions in order to procede"
       Message.Style("color") = "red"
         BindGrid()
         Exit Sub
      End If
      ' Build a SQL INSERT statement string for all the input-form
      ' field values.
      insertCmd = "insert into Authors values (@Title, @FirstName, @Surname, @Username , @Password, @Address1, @Address2, @Address3, @Postcode, @JoinedDate, @Quarterly, @Annual, @DoB, @Gender, @TelHome, @TelWork, @TelMobile, @PrimaryEmail, @AlternativeEmail, @EmployerName, @Trade, @InterestClimbing, @InterestWalking, @InterestMoutaineering, @InterestCaving, @InterestMoutainBiking, @InterestLandOther, @InterestFlying, @InterestGliding, @InterestParachuting, @InterestHangliding, @InterestAirOther, @InterestPowerBoats, @InterestSailing, @InterestSurfing, @InterestWindSurfing, @interestCanoeKayak, @InterestSubAqua, @InterestWaterOther, @InterestRacing, @InterestMotorbikes, @InterestQuadBiking, @InterestMotorOther, @ExperienceLandSports, @ExperienceAirSports, @ExperienceWaterSports" _
         & "@ExperienceMotorSports);"
      ' Initialize the SqlCommand with the new SQL string.
      myCommand = New SqlCommand(insertCmd, myConnection)
      ' Create new parameters for the SqlCommand object and
      ' initialize them to the input-form field values.
      myCommand.Parameters.Add(New SqlParameter("@Title", _
         SqlDbType.VarChar, 50))
      myCommand.Parameters("@Title").Value = Title.Value
      myCommand.Parameters.Add(New SqlParameter("@FirstName", _
         SqlDbType.VarChar, 50))
      myCommand.Parameters("@FirstName").Value = FirstName.Value
      myCommand.Parameters.Add(New SqlParameter("@Surname", _
         SqlDbType.VarChar, 50))
      myCommand.Parameters("@Surname").Value = Surname.Value
      myCommand.Parameters.Add(New SqlParameter("@Username", _
         SqlDbType.Char, 50))
      myCommand.Parameters("@Username").Value = Username.Value
      myCommand.Parameters.Add(New SqlParameter("@Password", _
         SqlDbType.VarChar, 50))
      myCommand.Parameters("@Password").Value = Password.Value
      myCommand.Parameters.Add(New SqlParameter("@Address1", _
         SqlDbType.VarChar, 20))
      myCommand.Parameters("@Address1").Value = Address1.Value
      myCommand.Parameters.Add(New SqlParameter("@Address2", _
         SqlDbType.VarChar, 50))
      myCommand.Parameters("@Address2").Value = Address2.Value
       myCommand.Parameters.Add(New SqlParameter("@Address3", _
         SqlDbType.VarChar, 50))
      myCommand.Parameters("@Address3").Value = Address3.Value
      myCommand.Parameters.Add(New SqlParameter("@Postcode", _
         SqlDbType.Char, 50))
      myCommand.Parameters("@Postcode").Value = Postcode.Value
      myCommand.Parameters.Add(New SqlParameter("@JoinedDate", _
         SqlDbType.VarChar,10))
      myCommand.Parameters("@JoinedDate").Value = JoinedDate.Value
      myCommand.Parameters.Add(New SqlParameter("@Quarterly", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@Quarterly").Value = Quarterly.Value
      myCommand.Parameters.Add(New SqlParameter("@Annual", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@Annual").Value = Annual.Value
      myCommand.Parameters.Add(New SqlParameter("@DoB", _
         SqlDbType.VarChar,10))
      myCommand.Parameters("@DoB").Value = Dob.Value
      myCommand.Parameters.Add(New SqlParameter("@Gender", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@Gender").Value = Gender.Value
      myCommand.Parameters.Add(New SqlParameter("@TelHome", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@TelHome").Value = TelHome.Value
      myCommand.Parameters.Add(New SqlParameter("@TelWork", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@TelWork").Value = TelWork.Value
      myCommand.Parameters.Add(New SqlParameter("@TelMobile", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@TelMobile").Value = TelMobile.Value
      myCommand.Parameters.Add(New SqlParameter("@PrimaryEmail", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@PrimaryEmail").Value = PrimaryEmail.Value
      myCommand.Parameters.Add(New SqlParameter("@AlternativeEmail", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@AlternativeEmail").Value = AlternativeEmail.Value
      myCommand.Parameters.Add(New SqlParameter("@EmployerName", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@EmployerName").Value = EmployerName.Value
      myCommand.Parameters.Add(New SqlParameter("@Trade", _
         SqlDbType.VarChar,50))
      myCommand.Parameters("@Trade").Value = Trade.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestWalking", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestWalking").Value = InterestWalking.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestMountaineering", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestMountaineering").Va lue = InterestMountaineering.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestCaving", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestCaving").Value = InterestCaving.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestMountainBikinging", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestMountainBikinging") .Value = InterestMountainBiking.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestLandOther", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestLandOther").Value = LandOther.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestFlying", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestFlying").Value = InterestFlying.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestGliding", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestGliding").Value = InterestGliding.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestParachuting", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestParachuting").Value = InterestParachuting.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestHangliding", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestHangliding").Value = InterestHangliding.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestAirOther", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestAirOther").Value = InterestAirOther.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestPowerBoats", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestPowerBoats").Value = InterestPowerBoats.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestSailing", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestSailing").Value = SailClimbing.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestSurfing", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestSurfing").Value = InterestSurfing.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestWindSurfing", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestWindSurfing").Value = InterestWindSurfing.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestCanoeKayak", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestCanoeKayak").Value = InterestCanoeKayak.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestSubAqua", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestSubAqua").Value = InterestSubAqua.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestWaterOther", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestWaterOther").Value = InterestWaterOther.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestRacing", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestRacing").Value = InterestRacing.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestMotorbikes", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestMotorbikes").Value = InterestMotorbikes.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestQuadBiking", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestQuadBiking").Value = InterestQuadBiking.Value
      myCommand.Parameters.Add(New SqlParameter("@InterestMotorOther", _
         SqlDbType.VarChar,1))
      myCommand.Parameters("@InterestMotorOther").Value = InterestMotorOther.Value
      myCommand.Parameters.Add(New SqlParameter("@ExperienceLandSports", _
         SqlDbType.VarChar,1000))
      myCommand.Parameters("@ExperienceLandSports").Valu e = ExperienceLandSports.Value
      myCommand.Parameters.Add(New SqlParameter("@ExperienceAirSports", _
         SqlDbType.VarChar,1000))
      myCommand.Parameters("@ExperienceAirSports").Value = ExperienceAirSports.Value
      myCommand.Parameters.Add(New SqlParameter("@ExperienceWaterSports", _
         SqlDbType.VarChar,1000))
      myCommand.Parameters("@ExperienceWaterSports").Val ue = ExperienceWaterSports.Value
      myCommand.Parameters.Add(New SqlParameter("@ExperienceMotorSports", _
         SqlDbType.VarChar,1000))
      myCommand.Parameters("@ExperienceMotorSports").Val ue = ExperienceMotorSports.Value
      myCommand.Connection.Open()
      ' Test whether the new row can be added and display the
      ' appropriate message box to the user.
      Try
         myCommand.ExecuteNonQuery()
         Message.InnerHtml = "<b>Record Added</b><br>" & insertCmd
      Catch ex As SqlException
         If ex.Number = 2627 Then
            Message.InnerHtml = "ERROR: A record already exists with " _
               & "the same primary key"
         Else
            Message.InnerHtml = "ERROR: Could not add record, please " _
               & "ensure the fields are correctly filled out"
            Message.Style("color") = "red"
         End If
     End Try

     myCommand.Connection.Close()
     BindGrid()
   End Sub

   ' BindGrid connects to the database and implements a SQL
   ' SELECT query to get all the data in the "Authors" table
   ' of the database.
   Sub BindGrid()
      Dim myConnection As SqlConnection
      Dim myCommand As SqlDataAdapter
      ' Create a connection to the "pubs" SQL database located on
      ' the local computer.
      myConnection = New SqlConnection("server=213.171.193.1;" _
         & "database=MyTime;Trusted_Connection=Yes")
      ' Connect to the SQL database using a SQL SELECT query to get all
      ' the data from the "Authors" table.
      myCommand = New SqlDataAdapter("SELECT * FROM authors", _
         myConnection)
      ' Create and fill a new DataSet.
      Dim ds As DataSet = New DataSet()
      myCommand.Fill(ds)
      ' Bind the DataGrid control to the DataSet.
      MyDataGrid.DataSource = ds
      MyDataGrid.DataBind()
   End Sub
</script>
<head></head>
<body>
<table width="100%" align="center" cellpadding="0" cellspacing="0">

<tr height="40" valign="top">
<td colspan="7"><h3>Membership Type:</h3></td></tr>

<tr height="40" valign="top">
<td>Quarterly (£90)
<br /><br />Annually (£315)
<td colspan="6">
<input type="radio" name="MembershipType" id="quarterly" value="quarterly"><br /><br />
<input type="radio" name="MembershipType" id="annual" value="annual" checked>
</td>
</tr>

<tr height="40" valign="top"></tr>

<tr height="40" valign="top">
<td colspan="7"><h3>Contact Details:</h3></td></tr>

<tr height="40" valign="top">
<td>Title:</td>
<td colspan="6"><select name="Title">
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Ms">Ms</option>
<option value="Other">Other</option>
</select>
</td>
</tr>
<tr height="40" valign="top">
<td>First Name:</td>
<td colspan="2"><input type="text" name="FirstName" style="width: 240px" />
</td><td width="10"></td>
<td>Surname:</td>
<td colspan="2">
<input type="text" name="Surname" style="width: 240px" />
</td>
</tr>
<tr height="40" valign="top">
<td>Primary Email:</td>
<td colspan="2"><input type="text" name="PrimaryEmail" style="width: 240px" />
</td><td></td>
<td>Alternative Email:</td>
<td colspan="2">
<input type="text" name="AlternativeEmail" style="width: 240px" />
</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td>
Address:
</td>
<td colspan="2">
<input type="text" name="Address1" style="width: 240px" />
</td><td></td>
<td>Home Telephone:</td>
<td colspan="2">
<input type="text" name="TelHome" style="width: 240px" />
</td>
</tr>
<tr height="30" valign="top">
<td></td>
<td colspan="2">
<input type="text" name="Address2" style="width: 240px" />
</td><td></td>
<td>Mobile Telephone:</td>
<td colspan="2">
<input type="text" name="TelMobile" style="width: 240px" />
</td>
</tr>
<tr height="30" valign="top">
<td></td>
<td colspan="2">
<input type="text" name="Address3" style="width: 240px" />
</td><td></td>
<td>Work Telephone:</td>
<td colspan="2">
<input type="text" name="TelWork" style="width: 240px" />
</td>
</tr>
<tr height="30" valign="top">
<td>Postcode:</td>
<td colspan="2">
<input type="text" name="Postcode" style="width: 100px" />
</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="40" valign="top">
<td>Date of Birth (dd/mm/19yy):</td>
<td colspan="2">
<input type="text" name="DoB" maxlength="10" />
</td><td></td>
<td>Gender:</td>
<td colspan="2"><select name="Gender">
<option value="M">Male</option>
<option value="F">Female</option>
</select>
</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="40" valign="top">
<td>Employer / Company:</td>
<td colspan="2">
<input type="text" name="EmployerName" style="width: 240px" />
</td><td></td>
<td>Profession / Job Title:</td>
<td colspan="2">
<input type="text" name="Trade" style="width: 240px" />
</td>
</tr>

<tr height="40" valign="top"></tr>

<tr height="40" valign="top">
<td colspan="7"><h3>Interests:</h3>
    <p>
        Please indicate the activities you are interested in below.&nbsp; This is by no
        means an exhaustive list of the activities which we hope to run - feel free to contact
        us with your own suggestions and requirements.</p>

</td></tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestClimbing" /></td>
<td>
    &nbsp; Climbing</td>
<td align="right"><input type="checkbox" name="InterestWalking" /></td>
<td colspan="2">
    &nbsp; Walking</td>
<td align="right"><input type="checkbox" name="InterestMountaineering" /></td>
<td>
    &nbsp; Mountaineering</td>
</tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestCaving" /></td>
<td>
    &nbsp; Caving / Potholing</td>
<td align="right"><input type="checkbox" name="InterestMountainbiking" /></td>
<td colspan="2">
    &nbsp; Mountainbiking</td>
<td align="right"><input type="checkbox" name="InterestLandOther" /></td>
<td>
    &nbsp; Other land sports</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestFlying" /></td>
<td>
    &nbsp; Flying</td>
<td align="right"><input type="checkbox" name="InterestGliding" /></td>
<td colspan="2">
    &nbsp; Gliding</td>
<td align="right"><input type="checkbox" name="InterestParachuting" /></td>
<td>
    &nbsp; Parachuting / Skydiving</td>
</tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestHangliding" /></td>
<td>
    &nbsp; Hangliding</td>
<td align="right"><input type="checkbox" name="InterestAirOther" value="1" /></td>
<td colspan="2">
    &nbsp; Other air sports</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestPowerBoats" /></td>
<td>
    &nbsp; Powerboats</td>
<td align="right"><input type="checkbox" name="InterestSailing" /></td>
<td colspan="2">
    &nbsp; Sailing</td>
<td align="right"><input type="checkbox" name="InterestSurfing" /></td>
<td>
    &nbsp; Surfing</td>
</tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestWindsurfing" /></td>
<td>
    &nbsp; Windsurfing</td>
<td align="right"><input type="checkbox" name="InterestCanoeKayak" /></td>
<td colspan="2">
    &nbsp; Canoeing / Kayaking</td>
<td align="right"><input type="checkbox" name="interestcoasteering" /></td>
<td>
    &nbsp; Coasteering</td>
</tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestSubAqua" /></td>
<td>
    &nbsp; Sub-Aqua / Diving</td>
<td align="right"><input type="checkbox" name="InterestWaterOther" /></td>
<td colspan="2">
    &nbsp; Other aqua sports</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestRacing" /></td>
<td>
    &nbsp; Racing</td>
<td align="right"><input type="checkbox" name="InterestMotorbikes" /></td>
<td colspan="2">
    &nbsp; Motorbikes</td>
<td align="right"><input type="checkbox" name="InterestQuadBiking" /></td>
<td>
    &nbsp; Quad Biking</td>
</tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestMotorOther" /></td>
<td>
    &nbsp; Other motor sports</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestSkiing" /></td>
<td>
    &nbsp; Skiing</td>
<td align="right"><input type="checkbox" name="InterestSnowboarding" /></td>
<td colspan="2">
    &nbsp; Snowboarding</td>
<td align="right"><input type="checkbox" name="InterestWinterOther" /></td>
<td>
    &nbsp; Other winter sports</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="30" valign="top">
<td align="right"><input type="checkbox" name="InterestSocial" /></td>
<td>
    &nbsp; Social Activities</td>
<td align="right"><input type="checkbox" name="InterestOther" /></td>
<td colspan="2">
    &nbsp; Other</td>
<td>Please describe:</td>
<td align="right"><input type="text" name="OtherDescription" /></td>
</tr>

<tr height="40" valign="top"></tr>

<tr height="40" valign="top">
<td colspan="7"><h3>Experience/Qualifications:</h3></td></tr>
<tr height="40" valign="top">
<td>Do you have any experience or qualifications in land sports?<br /><br /><i>If yes, please give details.</i></td>
<td colspan="2"><textarea name="ExperienceLandSports" cols="28" rows="5"></textarea>
</td><td></td>
<td>Do you have any experience or qualifications in air sports?<br /><br /><i>If yes, please give details.</i></td>
<td colspan="2"><textarea name="ExperienceAirSports" cols="28" rows="5"></textarea>
</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="40" valign="top">
<td>Do you have any experience or qualifications in aqua sports?<br /><br /><i>If yes, please give details.</i></td>
<td colspan="2"><textarea name="ExperienceWaterSports" cols="28" rows="5"></textarea>
</td><td></td>
<td>Do you have any experience or qualifications in motor sports?<br /><br /><i>If yes, please give details.</i></td>
<td colspan="2"><textarea name="ExperienceMotorSports" cols="28" rows="5"></textarea>
</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="40" valign="top">
<td>Do you have any experience or qualifications in winter sports?<br /><br /><i>If yes, please give details.</i></td>
<td colspan="2"><textarea name="ExperienceWinterSports" cols="28" rows="5"></textarea>
</td><td></td>
<td>Do you have any other experience or qualifications you would like to tell us about?<br /><br /><i>If yes, please give details.</i></td>
<td colspan="2"><textarea name="ExperienceOther" cols="28" rows="5"></textarea>
</td>
</tr>
<tr height="20" valign="top"></tr>
<tr height="40" valign="top">
<td colspan="7" class="style4"><br />
<p>MyTime respects your privacy and will <b>never</b> share any of your personal details with a third party.</p>
<p>I confirm that I have read and accept the <a href="T&C.html" target="_blank"><b>Terms & Conditions</b></a> of MyTime membership. <input type="checkbox" name="AcceptT&C" /></p>
</td></tr>

<tr height="20" valign="top"></tr>
<tr height="20" valign="top"></tr>

<tr height="40" valign="top">
<td colspan="7" class="style4" align="center">
<input type="submit" value="I accept the terms and conditions and wish to proceed to payment">
</td>
</tr>

   </table>


</body>
</html>

 
Old July 19th, 2007, 12:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hey there.. i didn't read your entire code.. but you miss a comma in this string (between ExperienceWaterSports and ExperienceMotorSports):

Code:
"insert into Authors values (@Title, @FirstName, @Surname, @Username , @Password, @Address1, @Address2, @Address3, @Postcode, @JoinedDate, @Quarterly, @Annual, @DoB, @Gender, @TelHome, @TelWork, @TelMobile, @PrimaryEmail, @AlternativeEmail, @EmployerName, @Trade, @InterestClimbing, @InterestWalking, @InterestMoutaineering, @InterestCaving, @InterestMoutainBiking, @InterestLandOther, @InterestFlying, @InterestGliding, @InterestParachuting, @InterestHangliding, @InterestAirOther, @InterestPowerBoats, @InterestSailing, @InterestSurfing, @InterestWindSurfing, @interestCanoeKayak, @InterestSubAqua, @InterestWaterOther, @InterestRacing, @InterestMotorbikes, @InterestQuadBiking, @InterestMotorOther, @ExperienceLandSports, @ExperienceAirSports, @ExperienceWaterSports," _
         & "@ExperienceMotorSports);"


maybe that's the problem???

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old July 19th, 2007, 03:07 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:
Active Server Pages error 'ASP 0221'

Invalid @ Command directive

/directinput.asp, line 1

The specified 'import Namespace="System.data" ' option is unknown or invalid.
That's not ASP.NET, that's ASP. Why is your page named .ASP? The ASP.NET runtime won't ever see this (unless of course you remap IIS to send .ASP page to the ASP.NET ISAPI).

-Peter
 
Old July 20th, 2007, 06:12 AM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Hey GBianchi - cheers; comma corrected!

Peter,
I'm not so sure about that the code was lifted from MSDN .Net page and states that a suitable example of the code in action is available in ASP.net quickstart...

My hosts say that I am on a .NET server so I

I'm not saying you're wrong; you probably know a lot more than me...

What should I save it as...I tried .html and it doesn't run the program just the form...I tried .aspx and it gives a server runtime error which cannot be explained

I'm so close to getting this started and it's all proving rather aggravating...all your help is GREATLY appreciated

Jim

 
Old July 20th, 2007, 08:15 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:Originally posted by jmsherry
 I'm not so sure about that the code was lifted from MSDN .Net page and states that a suitable example of the code in action is available in ASP.net quickstart...

Huh? Who mentioned MSDN?

The fact is, the error message you are showing us is a classic ASP error.

ASP.NET web forms need to be named with the ASPX extension otherwise (using default settings) they will not work. IIS has .ASPX files mapped to the ASP.NET runtime handler plain and simple.

If you try it as .ASPX what is the error you get? Perhaps it is not so unexplainable as you think. Post the error message so we can figure it out.

The web host I use supports ASP.NET 1.1 and 2.0. But you have to set which framework you want to use in their online control panel. Perhaps you have the same situation.

-Peter
 
Old July 20th, 2007, 09:06 AM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default

This is the error I get for .aspx

Dynamic website (using scripts or MS FrontPage) (Free)
This website will be hosted on a server designed specifically for using scripts.
Include ASP, PHP, Perl, compiled CGI, ISAPI and SHTML scripting.
You should also choose this option if you intend to use Microsoft FrontPage Extensions.
Enable ASP.NET 2.0 (Free)

This is my server package - ASP.NET 2.0 is enabled...This is the error I get...

Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".



<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.



<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

 
Old July 20th, 2007, 09:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

ok.. just do what the error say.. create the custom error tag and you will receive a more complete error... and we can try to trace it...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old July 20th, 2007, 10:00 AM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Gonzalo,

The web.config file I would presume to be on their .NET servers and therefore uneditable by myself...I have asked them though (awaiting reply)...

 
Old July 20th, 2007, 10:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

mmm.. at least in the provider i use, you upload your web.config file.. because you have application data inside.. usually you upload it..

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old July 20th, 2007, 10:29 AM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
Default

in aspnet_client folder I have found system_web I'm not sure if that is it...

How do you create a tag - is it a .txt file or an HTML file??






Similar Threads
Thread Thread Starter Forum Replies Last Post
I don't understand for some contents... jay0715 BOOK: Ivor Horton's Beginning Visual C++ 2005 0 November 4th, 2007 07:39 AM
Trying to understand execution flow jnbutler BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 1 August 4th, 2007 04:55 PM
I still do not understand aude_poullain ASP.NET 1.0 and 1.1 Basics 2 February 7th, 2007 09:11 PM
Who can understand this book? HandSomeLi All Other Wrox Books 2 October 20th, 2004 04:12 PM
i can't understand this error! ion Classic ASP Databases 2 September 23rd, 2003 03:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.