Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

The multi-part identifier could not be bound??

Posted on 2011-02-18
5
Medium Priority
?
632 Views
Last Modified: 2012-05-11
I am getting this error when running this update query. Can someone help me to figure out why?

ERROR: The multi-part identifier could not be bound.

Session("FileName") = File.FileName
                              
'test = (Session("FileName"))   NOT WORK
'test = "FileName.txt"   NOT WORK
test = 3   WORKS


Thanks

 Table
Session("FileName") = File.FileName
					
					'test = (Session("FileName"))
					'test = "FileName.txt"
					test = 3
					
					sSQL = "update RegWorkDetail set IsItemComplete = 1, UpFName = " & test & " where SGID = " & Session("strSGID") & " and RWID = " & Request.QueryString("RWID")
					oConn.Execute(sSQL)

Open in new window

0
Comment
Question by:Ahelbling
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 15

Accepted Solution

by:
derekkromm earned 2000 total points
ID: 34928631
you need to put quotes around strings in the sql

so ...UpFName = '" & test & "' where
0
 

Author Comment

by:Ahelbling
ID: 34928651
Thanks!
0
 
LVL 60

Expert Comment

by:HainKurt
ID: 34928667
sSQL = "update RegWorkDetail set IsItemComplete = 1, UpFName = " & test & " where SGID = " & Session("strSGID") & " and RWID = " & Request.QueryString("RWID")
-->
sSQL = "update RegWorkDetail set IsItemComplete = 1, UpFName = '" & test & "' where SGID = '" & Session("strSGID") & "' and RWID = '" & Request.QueryString("RWID") & "'"

assuming Request.QueryString("RWID") & Session("strSGID") are also strings...
0
 
LVL 15

Expert Comment

by:derekkromm
ID: 34928709
Also, something to keep in mind is that if the string contains a ' it'll cause issues. So in general, you'll want to replace any ' with '' prior to concatenating the string.
0
 

Author Comment

by:Ahelbling
ID: 34928854
Got it = thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question