Hi,
I'm new to ASP, I normally develop in PHP but this little project requires me to use ASP. Being a newbie in this I've run into some difficulty.
I'm modifying code from a third party. Basicaly there is a site which I am replacing next year with a new branded version and this new site is powered bya DB. However, the existing site needs to be kept up to date as well. So rather than hard code HTMl for the event listing on the existing site as well as update the DB on the new site I thought I would use the DB to generate the event listing on the existing site.
Right, thats the background, here's the problem.
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1044: Cannot use more than one type in a for, using, fixed, or declaration statement
So the code looks like: -
<%@ Page language="c#" Codebehind="events.aspx.cs" AutoEventWireup="false" Inherits="ChristianLeadersForum.events" %>
-
<%@Register TagPrefix="Controls" TagName="Navigation" Src="Controls/Navigation.ascx" %>
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-
<title>Christian Leaders' Forum - Information</title>
-
<link rel="stylesheet" type="text/css" href="_common/css/screen.css" />
-
<!--[if IE 6]>
-
<link rel="stylesheet" type="text/css" href="_common/css/ie6 .css" />
-
<![endif]-->
-
</head>
-
<body>
-
<div id="masthead">
-
<div id="container">
-
<h1><img src="_common/img/logo-clf.png" alt="Christian Leaders' Forum" /></h1>
-
<Controls:Navigation id="Navigation" Runat="server"></Controls:Navigation>
-
</div>
-
</div>
-
<div id="wrap">
-
<div id="wrap-content" class="cf">
-
<%
-
Dim sConnection, objConn , objRS
-
-
sConnection = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=ip:servername; DATABASE=myDB; UID=user;PASSWORD=password; OPTION=3"
-
-
Set objConn = Server.CreateObject("ADODB.Connection")
-
-
objConn.Open(sConnection)
-
-
Set objRS = objConn.Execute("SELECT a.ID, a.venueID, a.speakerID, a.thumbnail, a.title, a.summary, a.details, a.isFood, a.canBook, concat(date_format(a.startDate,'%D-'), date_format(a.endDate, '%D %b %Y')) as date1, date_format(a.startDate, '%D %b %Y') as date2, a.startDate, a.endDate, a.startTime, a.endTime, b.URL, b.name, b.line1, b.line2, b.postcode, c.name as speaker, c.biog, c.image FROM tbl_event a LEFT OUTER JOIN tbl_venue b on b.ID = a.venueID LEFT OUTER JOIN tbl_speaker c on c.ID = a.speakerID")
-
-
While Not objRS.EOF
-
Response.Write & "<h3>" & objRS.Fields("title") & "</h3>"
-
Response.Write & "<p></p><h3>Date: </h3>"
-
If objRS.Fields("endDate") > objRS.Fields("startDate") Then
-
Response.Write & objRS.Fields("date1")
-
Else
-
Response.Write & objRS.Fields("date2")
-
End If
-
Response.Write & "<h3>Venue: </h3>"
-
Response.Write & "<p><a target='_blank' title='google map of venue' href='" & onjRS.Fields["URL"] & "'>" & objRS.Fields["name"] & "</a><br />"
-
Response.Write & objRS.Fields["line1"] & "<br />" & objRS.Fields["line2"] & "<br />" & objRS.Fields["postcode"] & "</p>" &
-
Response.Write & "<h3>Extra Information: </h3>" & onjRS.Fields["details"]
-
objRS.MoveNext
-
Wend
-
-
objRS.Close
-
Set objRS = Nothing
-
objConn.Close
-
Set objConn = Nothing
-
%>
-
</div>
-
<p id="footer">© Christian Leaders' Forum 2007. <a href="http://www.mandogroup.com/">Web Design by Mando Group.</a></p>
-
</div>
-
</body>
-
</html>
-
If someone can point me in the right direction and help me out with this that would be great.
Many thanks
nathj
7 3837
Hi nathj,
Firstly, are you using classic ASP or ASP.NET? There is a distinct difference between the two.
Your inline code suggests you are using classic ASP but the declarations before the <!DOCTYPE> tag are for ASP.NET only, hence why there is immediate confusion.
Let us know what language you are writing in (classic ASP or ASP.NET) and we can guide you further. If you can't tell us that, then we can translate the code into one or the other for you in very little time.
Best regards,
medicineworker
Hi nathj,
Firstly, are you using classic ASP or ASP.NET? There is a distinct difference between the two.
Your inline code suggests you are using classic ASP but the declarations before the <!DOCTYPE> tag are for ASP.NET only, hence why there is immediate confusion.
Let us know what language you are writing in (classic ASP or ASP.NET) and we can guide you further. If you can't tell us that, then we can translate the code into one or the other for you in very little time.
Best regards,
medicineworker
Hi medicineworker,
I must be honest I have no idea. I didn't write this site myself, I am just maintaining it for 6 months. I thought it was classic asp but if the <DOCTYPE> indicates othrewsie then perhaps it's asp.Net.
I don't have .Net installed (I have the discs though). I guess I'll have to bow to your superior knowledge as on this one I don't have a clue.
Cheers
nathj
Hi nathj,
This is what causes confusion: -
<%@ Page language="c#" Codebehind="events.aspx.cs" AutoEventWireup="false" Inherits="ChristianLeadersForum.events" %>
-
<%@Register TagPrefix="Controls" TagName="Navigation" Src="Controls/Navigation.ascx" %>
-
That is ASP.NET declaration code - it tells the web server that the page being processed is an ASP.NET page and therefore the ASP.NET engine should handle the processing of it.
However the code between <% and %> in the document body is classic ASP.
Do you need the in-built navigation control that the page is trying to include (<Controls:Navigtation runat="server"></Controls:Navigtation>)?
Best regards,
medicineworker
Hi nathj,
This is what causes confusion: -
<%@ Page language="c#" Codebehind="events.aspx.cs" AutoEventWireup="false" Inherits="ChristianLeadersForum.events" %>
-
<%@Register TagPrefix="Controls" TagName="Navigation" Src="Controls/Navigation.ascx" %>
-
That is ASP.NET declaration code - it tells the web server that the page being processed is an ASP.NET page and therefore the ASP.NET engine should handle the processing of it.
However the code between <% and %> in the document body is classic ASP.
Do you need the in-built navigation control that the page is trying to include (<Controls:Navigtation runat="server"></Controls:Navigtation>)?
Best regards,
medicineworker
Hi medicineworker,
Thanks fro the swift reply.
I do need that code - as this is the main navigation of the page. The alternative I guess is to simply duplicate that navigation code, unless you can convert the code I have written (classic ASP) into ASP.net?
Many thanks
nathj
Hi nathj,
Converting ASP.NET to ASP (the main navigation) will be more time-consuming that converting the classic ASP code to .NET.
I will review your code on my lunch break and see what I can come up with.
Best regards,
medicineworker
P.S. ASP.NET runtimes (the binaries needed to compile and interpret .NET code) come as redistributables from Microsoft's website (and pre-packaged with Windows XP SP3 onwards), and the classic ASP runtimes are already included on all Windows OS's since NT4. If you would consider getting into .NET (you mentioned you're a predominantly PHP programmer) then I recommend going to Microsoft's website and downloading Visual Web Developer Express Edition and Microsoft SQL Server Express Edition - both are free to download and use for personal usage (or MySQL Community Edition and the .NET connector), it'll give you a good start to kick off ASP.NET web development. I also recommend a number of good reference books by O'Reilly or Sams Publishing.
Hi nathj,
Converting ASP.NET to ASP (the main navigation) will be more time-consuming that converting the classic ASP code to .NET.
I will review your code on my lunch break and see what I can come up with.
Best regards,
medicineworker
P.S. ASP.NET runtimes (the binaries needed to compile and interpret .NET code) come as redistributables from Microsoft's website (and pre-packaged with Windows XP SP3 onwards), and the classic ASP runtimes are already included on all Windows OS's since NT4. If you would consider getting into .NET (you mentioned you're a predominantly PHP programmer) then I recommend going to Microsoft's website and downloading Visual Web Developer Express Edition and Microsoft SQL Server Express Edition - both are free to download and use for personal usage (or MySQL Community Edition and the .NET connector), it'll give you a good start to kick off ASP.NET web development. I also recommend a number of good reference books by O'Reilly or Sams Publishing.
Hi medicineworker,
Thanks for the help and for the advice. I really appreciate you taking the time to help me out.
Many thanks
nathj
I got to thinking about the ASP.Net and classic ASP issue and decided I would remove the .net stuff, duplicate the navigation and see what happens.
On doing this I get a bit further but it's not quite right. If you take a look at www.christianleadersforum.com.events.asp you'll see what I mean.
Can you shed any light on this?
Many thanks
nathj
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tom Martin |
last post by:
I'm a Java Web developer NEWBIE that has inherited a website that
fails every 2 hours due to poor connection pooling between Tomcat
4.0.6 and mySQL. In efforts to resolve this problem, I've...
|
by: Robert Mazur |
last post by:
MySQL 5.0 alpha (binary install) on
Solaris 9 -or- RedHat 8.0
mysql-connector-java-3.0.8-stable
-----------------------
Is there something different going on with JDBC and the alpha version...
|
by: Mike Chirico |
last post by:
Interesting Things to Know about MySQL
Mike Chirico (mchirico@users.sourceforge.net)
Copyright (GPU Free Documentation License) 2004
Last Updated: Mon Jun 7 10:37:28 EDT 2004
The latest...
|
by: MLH |
last post by:
I'm supposed to set a password for the MySQL root user. The output of
mysql_install_db instructed me to run the following commands...
/usr/bin/mysqladmin -u root -h appserver password mynwewpasswd...
|
by: cwho.work |
last post by:
Hi!
We are using apache ibatis with our MySQL 5.0 database (using innodb
tables), in our web application running on Tomcat 5. Recently we
started getting a number of errors relating to...
|
by: tulika dutta |
last post by:
after 8 hrs my MySQL connection with JDBC gets time out. It gives the error
java.sql.SQLException: No operations allowed after connection closed.Connection was implicitly closed due to underlying...
|
by: vincedav31 |
last post by:
I have a connection to a server and my database. I use it like this in my code :
Class.forName("com.mysql.jdbc.Driver");
String DBurl = "jdbc:mysql://138.63.222.7:3306/ns3";
m_connection =...
|
by: Atli |
last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t.
In situations where your PHP application...
|
by: spatro |
last post by:
Hi,
I am trying to install DBD::mysql using the CPAN and I am facing the following error:
cpan> install DBD::mysql
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Warning:...
|
by: alex |
last post by:
I've converted a latin1 database I have to utf8. The process has been:
# mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore
--skip-set-charset mydb mydb.sql
# iconv -f...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |