| |

VerySource

 Forgot password?
 Register
Search
View: 692|Reply: 3

Problems with variables in the sqldatasource data source.

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-31 13:40:01
| Show all posts |Read mode
In the sqldatasource data source control, SelectCommand = "SELECT * FROM [test] where field 1 =" <% # getno ()%> ""

I tracked the value of getno () and got it normally. But why doesn't the query result work? Simply replace #getno ()%> with the resulting character.

Thank you!
Reply

Use magic Report

0

Threads

21

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-3-10 00:00:01
| Show all posts
If this selectcommand has parameters, remove it
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 United States

 Author| Post time: 2020-3-14 17:45:01
| Show all posts
Remove it
==============
then what should we do?
Reply

Use magic Report

0

Threads

13

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-4-20 19:00:01
| Show all posts
Assign values ​​to SelectCommand in the code behind, don't use a mixed method in the foreground, this is easy to go wrong.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list