[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

The multi-part identifier could not be bound??

Posted on 2011-02-18
5
Medium Priority
?
633 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
  • 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 61

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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Suggested Courses

872 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