473,378 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

What Did I Miss?

I have an aspx page (built in WebMatrix) with the code shown below but when
I run it if gives an error "Expression Expected" pointing to the first DB
call. It is as if the calls to the DB values - "<%#Container..." are not
understood?
This really did run last year (we on on a new ISP now but I don't see that
as causing a problem?)

Any suggestions are most welcome.

============= Code ==================
Function UpdateRecord(e, jn, c)
' e is evaluator NameID
' jn is Judge's Name
' c is caption
Dim strSQL as String
strSQL = "UPDATE judgeevaluations Set scoring = ??, Set dialog = ??" _
& " Where (judgename = '" &
<%#Container.DataItem("JudgeName")%> & "')" _ <=== Error points to here
& " AND (caption = '" & <%#Container.DataItem("caption")%> &
"')" _
& " AND evaluator = " & Session ("EvaluatorID")"
Dim connEval As OleDBConnection
Dim cmdUpdate As OLEDBCommand
connEval = New OleDBConnection( "Server=myServer;
UID=myID;PWD=****;database=DB_12345" )
cmdUpdate = New OleDBCommand(strSQL, connEval)
connEval.Open
cmdUpdate.ExecuteNonQuery
connEval.Close
End Function
Nov 19 '05 #1
2 1106
Wayne,
Is this code running inline (actually in the ASPX page) or are you
using a codebehind or dll?
One note i would make on a security stand point would be that you shouldn't
concatenate strings together from user input and then execute that against
the database. This leads to injections issues (potential hacks). But on to
the question asked.
I think its just a position of your &'s and an extra ". Its hard to
tell though unless I know if this is inline or not.

Your Code:
strSQL = "UPDATE judgeevaluations Set scoring = ??, Set dialog = ??" _
& " Where (judgename = '" &
<%#Container.DataItem("JudgeName")%> & "')" _ <=== Error points to here
& " AND (caption = '" & <%#Container.DataItem("caption")%>
& "')" _
& " AND evaluator = " & Session ("EvaluatorID")" <====Is
this an extra "

To work needs to be:
strSQL = "UPDATE judgeevaluations Set scoring = ??, Set dialog = ??" & _
" Where (judgename = '" &
<%#Container.DataItem("JudgeName")%> & "')" & _
" AND (caption = '" & <%#Container.DataItem("caption")%> &
"')" & _
" AND evaluator = " & Session ("EvaluatorID")

Hope this helps,
--
Duane Laflotte
MCSE, MCSD, MCDBA, MCSA, MCT, MCP+I
dl*******@criticalsites.com
http://www.criticalsites.com/dlaflotte


"Wayne Wengert" <wa***********@wengert.org> wrote in message
news:OF*************@TK2MSFTNGP12.phx.gbl...
I have an aspx page (built in WebMatrix) with the code shown below but when I run it if gives an error "Expression Expected" pointing to the first DB
call. It is as if the calls to the DB values - "<%#Container..." are not
understood?
This really did run last year (we on on a new ISP now but I don't see that
as causing a problem?)

Any suggestions are most welcome.

============= Code ==================
Function UpdateRecord(e, jn, c)
' e is evaluator NameID
' jn is Judge's Name
' c is caption
Dim strSQL as String
strSQL = "UPDATE judgeevaluations Set scoring = ??, Set dialog = ??" _
& " Where (judgename = '" &
<%#Container.DataItem("JudgeName")%> & "')" _ <=== Error points to here
& " AND (caption = '" & <%#Container.DataItem("caption")%> & "')" _
& " AND evaluator = " & Session ("EvaluatorID")"
Dim connEval As OleDBConnection
Dim cmdUpdate As OLEDBCommand
connEval = New OleDBConnection( "Server=myServer;
UID=myID;PWD=****;database=DB_12345" )
cmdUpdate = New OleDBCommand(strSQL, connEval)
connEval.Open
cmdUpdate.ExecuteNonQuery
connEval.Close
End Function

Nov 19 '05 #2
This is all inline.

Wayne

"Duane Laflotte" <dl*******@criticalsites.com> wrote in message
news:Ok***************@TK2MSFTNGP12.phx.gbl...
Wayne,
Is this code running inline (actually in the ASPX page) or are you
using a codebehind or dll?
One note i would make on a security stand point would be that you
shouldn't
concatenate strings together from user input and then execute that against
the database. This leads to injections issues (potential hacks). But on
to
the question asked.
I think its just a position of your &'s and an extra ". Its hard to
tell though unless I know if this is inline or not.

Your Code:
strSQL = "UPDATE judgeevaluations Set scoring = ??, Set dialog = ??" _
& " Where (judgename = '" &
<%#Container.DataItem("JudgeName")%> & "')" _ <=== Error points to here
& " AND (caption = '" & <%#Container.DataItem("caption")%>
& "')" _
& " AND evaluator = " & Session ("EvaluatorID")" <====Is
this an extra "

To work needs to be:
strSQL = "UPDATE judgeevaluations Set scoring = ??, Set dialog = ??" & _
" Where (judgename = '" &
<%#Container.DataItem("JudgeName")%> & "')" & _
" AND (caption = '" & <%#Container.DataItem("caption")%>
&
"')" & _
" AND evaluator = " & Session ("EvaluatorID")

Hope this helps,
--
Duane Laflotte
MCSE, MCSD, MCDBA, MCSA, MCT, MCP+I
dl*******@criticalsites.com
http://www.criticalsites.com/dlaflotte


"Wayne Wengert" <wa***********@wengert.org> wrote in message
news:OF*************@TK2MSFTNGP12.phx.gbl...
I have an aspx page (built in WebMatrix) with the code shown below but

when
I run it if gives an error "Expression Expected" pointing to the first DB
call. It is as if the calls to the DB values - "<%#Container..." are not
understood?
This really did run last year (we on on a new ISP now but I don't see
that
as causing a problem?)

Any suggestions are most welcome.

============= Code ==================
Function UpdateRecord(e, jn, c)
' e is evaluator NameID
' jn is Judge's Name
' c is caption
Dim strSQL as String
strSQL = "UPDATE judgeevaluations Set scoring = ??, Set dialog = ??" _
& " Where (judgename = '" &
<%#Container.DataItem("JudgeName")%> & "')" _ <=== Error points to
here
& " AND (caption = '" &
<%#Container.DataItem("caption")%>

&
"')" _
& " AND evaluator = " & Session ("EvaluatorID")"
Dim connEval As OleDBConnection
Dim cmdUpdate As OLEDBCommand
connEval = New OleDBConnection( "Server=myServer;
UID=myID;PWD=****;database=DB_12345" )
cmdUpdate = New OleDBCommand(strSQL, connEval)
connEval.Open
cmdUpdate.ExecuteNonQuery
connEval.Close
End Function


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: F. GEIGER | last post by:
When I start a py2exe-ed application I get the error 'ascii' codec can't encode character u'\xe9' in position 10: ordinal not in range(128) This is how I run py2exe: setup.py py2exe -O1...
9
by: Nadav | last post by:
Hi, I am tring to pass messages between threads, using the good old C++ I would call the GetMessage/PostThreadMessage APIs, Now, I am using C# and i can't find any equivalenty for these calls, any...
19
by: Charles Law | last post by:
Take a solution with a project hierarchy along the lines of an n-tier system, so that we have a data layer, business layer and presentation layer. The presentation layer is coupled to the business...
1
by: kmounkhaty | last post by:
Hi Guru, My profiler trace does not display SP:CACHEMISS event, even thought I drop store proc, clear both data cache and buffer cache but still does not work. Every thing works fine like:...
7
by: jg | last post by:
I setup a new windwos application project but I found out the sub main was not called, I tried various form of Main (functions, subs) still no luck. What did I miss? Public Class SolverForm Dim...
98
by: tjb | last post by:
I often see code like this: /// <summary> /// Removes a node. /// </summary> /// <param name="node">The node to remove.</param> public void RemoveNode(Node node) { <...> }
28
by: Useful Info | last post by:
Like on 9/11, the Federal Government apparently WANTED people to die at the hands of Cho at VA Tech, because they told campus police not to pursue Cho after the double homicide occurred. Story...
8
by: anukedari | last post by:
Hi, Could any boby please help to get the answers for the following questions: Is Apache always sends "X-Cache:MISS" header even when caching is off (disable)? or Can we say that cache...
21
by: Ram Prasad | last post by:
I am trying to write a simple libspf2 plugin code for my postfix ( milter) I am getting this unhelpful error message when I try to compile gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c...
0
by: manikandan | last post by:
dont miss it just open dont miss it just open dont miss it just open #############################
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.