Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i resolve this error. I had tried using this link but not working.

https://stackoverflow.com/questions/17739612/new-line-in-constant-error

What I have tried:

dtListBox = dLib.GetDataTable("declere @test table(SLNControl int,ControlOrderBy int) insert into @test values(" + stringData + ")update UIF_ControlProperties set SLNControl= tb.slnControl from @test tb.join UIF_ControlProperties cp on tb.slnControl = sp.SLNControl);
Posted
Updated 14-Mar-19 2:19am
Comments
Maciej Los 14-Mar-19 7:26am    
What values holds stringData variable?
Maciej Los 14-Mar-19 7:40am    
In your statement several mistakes occurs:
"declere @test table(SLNControl int,ControlOrderBy int) insert into @test values(" + stringData + ")update UIF_ControlProperties set SLNControl= tb.slnControl from @test tb.join UIF_ControlProperties cp on tb.slnControl = sp.SLNControl);

declere - it should be: declare
")update" - missing space between bracket and update statement
"from @test tb.join UIF_ControlProperties cp on tb.slnControl = sp.SLNControl" - wrong alias!
and finally:
("declere @test ... on tb.slnControl = sp.SLNControl); - missing double quote at the end of statement!

It looks like you are missing a closing double quote at the end of the sql command.

You probably need this

dtListBox = dLib.GetDataTable("declere @test table(SLNControl int,ControlOrderBy int) insert into @test values(" + stringData + ")update UIF_ControlProperties set SLNControl= tb.slnControl from @test tb.join UIF_ControlProperties cp on tb.slnControl = sp.SLNControl");
 
Share this answer
 
Take a look at your statement:
"declere @test table(SLNControl int,ControlOrderBy int) insert into @test values(" + stringData + ")update UIF_ControlProperties set SLNControl= tb.slnControl from @test tb.join UIF_ControlProperties cp on tb.slnControl = sp.SLNControl);

There's several mistakes:










WrongCorrect
1. wrong syntax:
declere
declare
2. missing space between bracket and update statement
")update"
") update"
3. wrong alias!
"from @test tb.join UIF_ControlProperties cp on tb.slnControl = sp.SLNControl"
"from @test tb.join UIF_ControlProperties cp on tb.slnControl = cp.SLNControl"
4. missing double quote at the end of statement!
("declare ... SLNControl);
("declare ... SLNControl");


But, the worse thing is that you're trying to fetch data when your command is used to modify data instead of select them!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900