Home > Net >  ASP.NET
ASP.NET

Time:10-16

RowUpdating

Dim Id1 As string=Str (GridView1 DataKeys (" e.R owIndex). The Value)
Dim the ADB As String="commodity number=@ commodity number,"
ZDB=ZDB + "commodity name=@ name of commodity,"
ZDB=ZDB + "commodity classification=@ commodity classification,"
ZDB=ZDB + "size=@ is specifications of products,"
AccessDataSource1. UpdateCommand="UPDATE SPTAB1 SET" + ZDB + Id1
The GridView. DataBind ()

Change once again after the change is wrong.
Has an invalid SelectedValue "drop1", because it is not in the list of projects, the value parameter name.

Beg bosses give directions!

CodePudding user response:

You put the
"The UPDATE SPTAB1 SET" + ZDB + Id1
Print it out to know,

CodePudding user response:

I send you a, you need to download my tool software, to change from already generated code
Dim SQLCmd As New Data. The SqlClient. SqlCommand (" Update S_Employee Set NumberStr=@ NumberStr, NameStr=@ NameStr, Potence=@ Potence, State=@ State, OTPKey=@ OTPKey, Phone=@ Phone, Email=@ Email, QQ=@ QQ, Address=@ Address, CreatedDate=@ CreatedDate, UserPassword=@ UserPassword, RndPassword=@ RndPassword, Remark=@ Remark, LoginDate=@ LoginDate, LoginIP=@ LoginIP, Branch=@ Branch, DeptID=@ DeptID where ID=@ ID ", the New Data. The SqlClient. SqlConnection (ConnString))
SQLCmd. Connection. The Open ()
SQLCmd. The Parameters. AddWithValue (" NumberStr GetRequest (" NumberStr ", 30)) 'employee number
SQLCmd. The Parameters. AddWithValue (" NameStr GetRequest (" NameStr ", 10)) 'name
SQLCmd. The Parameters. AddWithValue (Potence, GetRequest (" Potence, 8)) 'rights group ID
SQLCmd. The Parameters. AddWithValue (" State ", Val (GetRequest (" State ", 3))) State
'SQLCmd. The Parameters. AddWithValue (" OTPKey GetRequest (" OTPKey ", 50))
'OTP shield codeSQLCmd. The Parameters. AddWithValue (" Phone ", GetRequest (" Phone ", 30)) 'fixed Phone
SQLCmd. The Parameters. AddWithValue (" Email ", GetRequest (" Email ", 50)) 'Email
SQLCmd. The Parameters. AddWithValue (" QQ ", GetRequest (" QQ ", 20))
'QQ numberSQLCmd. The Parameters. AddWithValue (" Address ", GetRequest (" Address ", 255)) 'Address
SQLCmd. The Parameters. AddWithValue ()
SQLCmd. The Parameters. AddWithValue (" UserPassword ", GetRequest (" UserPassword ", 100)) 'user password
SQLCmd. The Parameters. AddWithValue (" RndPassword GetRequest (" RndPassword ", 8)) 'login password casually
SQLCmd. The Parameters. AddWithValue (" Remark ", GetRequest (255) "Remark",) 'note information
SQLCmd. The Parameters. AddWithValue ()
SQLCmd. The Parameters. AddWithValue (LoginIP, GetRequest (" LoginIP ", 15))
SQLCmd. The Parameters. AddWithValue (" Branch ", GetRequest (" Branch ", 8)) 'subordinate Branch
SQLCmd. The Parameters. AddWithValue (DeptID, GetRequest (" DeptID, 8)) 'department ID
SQLCmd. The Parameters. AddWithValue (" ID ", GetRequest (" ID ", 8))
SQLCmd. ExecuteNonQuery ()
SQLCmd. Connection. The Close () : SQLCmd. Dispose

AddLog (" modify S_Employee: "& amp; GetRequest (" NameStr "))
Msg="& lt; Script language=javascript> Alert (' warm prompt: the save operation success); EditClose (' Ref '); </script>"
MessgBox (" modify the save operation success, "" S_Employee. Aspx? The Menu="& amp; GetRequest (" Menu ") & amp; "& amp; SubMenu="& amp; GetRequest (" SubMenu ") & amp; "& amp; Page="& amp; GetRequest (" Page "))

CodePudding user response:


ZDB=ZDB + "size=@ is specifications of products,"//whether the last more than a,? And should add a where clause?
AccessDataSource1. UpdateCommand="UPDATE SPTAB1 SET" + ZDB + Id1
According to my understanding, the SQL statement of id1 conditions for updates, you here this connection programming modification,

CodePudding user response:

ZDB=ZDB + "size=@ is specifications of products,"//whether the last more than a,? And should add a where clause?
AccessDataSource1. UpdateCommand="UPDATE SPTAB1 SET" + ZDB + Id1
According to my understanding, the SQL statement of id1 conditions for updates, you here this connection programming modification,