| |

VerySource

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

access update problem

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-8 16:00:02
| Show all posts |Read mode
The relevant code is as follows:

                    comm1.CommandText = "update article set content = '" + newContent + "' where articleid =" + id "";
                    try
                    {
                        comm1.ExecuteNonQuery ();
                    }
                    catch (Exception)
                    {
                        
                        throw;
                    }

Syntax error (operator missing) in query expression '' <P align = center>
<OBJECT codeBase = http: //download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 height = 360 width = 480 classid = clsid: D27CDB6E-AE6D-11cf -96B8-444553540000> <PARAM NAME = "_ cx" VALUE =&quo '.

Brothers, what's going on? (Where newContent is a string, the value is: <P align = center>
<OBJECT codeBase = http: //download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 height = 360 width = 480 classid = clsid: D27CDB6E-AE6D-11cf -96B8-444553540000> <PARAM NAME = "_ cx" VALUE = "12700"> <PARAM NAME = "_ cy" VALUE = "9525"> <PARAM NAME = "FlashVars" VALUE = ""> <PARAM NAME = "Movie" VALUE = "http://swf.xyx007.com/yx007-swf/20169/4/201694125028.swf"> <PARAM NAME = "Src" VALUE = "http://swf.xyx007.com/yx007-swf/ 20169/4 / 201694125028.swf "> <PARAM NAME =" WMode "VALUE =" Window "> <PARAM NAME =" Play "VALUE ="-1 "> <PARAM NAME =" Loop "VALUE ="-1 "> <PARAM NAME = "Quality" VALUE = "Low"> <PARAM NAME = "SAlign" VALUE = ""> <PARAM NAME = "Menu" VALUE = "-1"> <PARAM NAME = "Base" VALUE = "" > <PARAM NAME = "AllowScriptAccess" VALUE = ""> <PARAM NAME = "Scale" VALUE = "ShowAll"> <PARAM NAME = "DeviceFont" VALUE = "0"> <PARAM NAME = "EmbedMovie" VALUE = "0 "> <PARAM NAME =" BGColor "VALUE =" "> <PARAM NAME =" SWRemote "VALUE =" "> <PARAM NAME =" MovieData "VALUE =" "> <PARAM NAME =" SeamlessTabbing "VALUE =" 1 " > <PARAM NAME = "Profile" VALUE = "0"> <PARAM NAME = "ProfileAddress" VA LUE = ""> <PARAM NAME = "ProfilePort" VALUE = "0">
<embed src = 'http: //swf.xyx007.com/yx007-swf/20169/4/201694125028.swf' type = 'application / x-shockwave-flash' pluginspage = 'http: //www.macromedia.com / go / getflashplayer 'quality =' high 'width =' 480 'height =' 360 '> </ embed> </ OBJECT> </ P>
Reply

Use magic Report

0

Threads

11

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-4-1 05:00:01
| Show all posts
Check if types match
TRY:
comm1.CommandText = "update [article] set [content] = '" + newContent + "' where articleid =" + id;
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-5-27 14:45:01
| Show all posts
The error message is this:

Syntax error (operator missing) in query expression ''&lt; P align = center&gt;&amp; nbsp;
&lt; OBJECT codeBase = http: //download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 height = 360 width = 480 classid = clsid: D27CDB6E-AE6D- 11cf-96B8-444553540000&gt;&lt; PARAM NAME =&quot; _cx&quot; VALUE =&quo '.
Reply

Use magic Report

0

Threads

23

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-5-27 19:00:01
| Show all posts
Interrupt the code and execute the SQL directly in the query.
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