CFF KB - Carrz-Fox-Fire Promotions Knowledge Base
CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.Knowledge Base
- Breadrumbs:
Must declare the scalar variable "@ColNames".
- Article ID:
6248 - Date Created
Thursday, June 2, 2022 - This Article Has been Viewed
405 times - Short Desc
The select statement gives the error Must declare the scalar variable during testing - Details
In ASP.NET, you may sometime get in a hurry and misspell the column name, causing the error Must declare the scalar variable. This happens in development and can frustrate a developer, especially if they are in a crunch situation. - Recreate Issueselect colOne, ColTwo from TableOne where ColOne=@CoOne
In the above example, the @CoOne is missing the l.
Causing the error, as the @ column name is the scalar name. - Resolve Issue
Looking at the code example above, we know that the @CoOne is not the correct way to spell the column name, thus giving us the error.
We need to make sure that we spell the Column name correctly for both sides of the = sign to correct the error.select colOne, ColTwo from TableOne where ColOne=@ColOne
Share With Friends (Updated 6-8-2010)
Recent Articles
All Topics
- Coming Soon - Knowledge Exchange
Trending Articles
- Microsoft VBScript runtime error '800a0046' Permission denied FileSystemObject 24695
- Microsoft OLE DB Provider for SQL Server error '80040e57' String or binary data would be truncated. or The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. 21297
- ADODB.Parameters error '800a0e7c' Parameter object is improperly defined 19544
- After Effects warning: Audio conforming failed for the following file .cfa. Perhaps due to disk space 17785
- The backup set holds a backup of a database other than the existing 16825