Solved

The multi-part identifier could not be bound??

Posted on 2011-02-18
5
625 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 500 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 51

Expert Comment

by:Huseyin KAHRAMAN
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

749 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