Hi all,
i am getting SQL update problem. as below
=============== =======error messages =============== ========
Server Error in '/CMS' Application.
--------------------------------------------------------------------------------
無值提供給 一或多個必 要參數。
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Data.Ole Db.OleDbExcepti on:
無值提供給 一或多個必 要參數。
Source Error:
Line 86: 'cmd.CommandTex t = "update client_list Set CLIENT_NAME
= '" & a & "' Where CLIENT_ID = 'John'"
Line 87: 'cmd.Connection = conn
Line 88: L.Text = cmd.ExecuteNonQ uery()
Line 89: conn.Close()
Line 90:
Source File: c:\inetpub\wwwr oot\CMS\UserDet ail.aspx.vb Line: 88
Stack Trace:
[OleDbException (0x80040e10):
無值提供給 一或多個必 要參數。]
System.Data.Ole Db.OleDbCommand .ExecuteCommand TextErrorHandli ng(Int32
hr)
System.Data.Ole Db.OleDbCommand .ExecuteCommand TextForSingleRe sult(tagDBPARAM S
dbParams, Object& executeResult)
System.Data.Ole Db.OleDbCommand .ExecuteCommand Text(Object&
executeResult)
System.Data.Ole Db.OleDbCommand .ExecuteCommand (CommandBehavio r
behavior, Object& executeResult)
System.Data.Ole Db.OleDbCommand .ExecuteReaderI nternal(Command Behavior
behavior, String method)
System.Data.Ole Db.OleDbCommand .ExecuteNonQuer y()
CMS.UserDetail. BUpdate_Click(O bject sender, EventArgs e) in
c:\inetpub\wwwr oot\CMS\UserDet ail.aspx.vb:88
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e)
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument)
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument)
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData)
System.Web.UI.P age.ProcessRequ estMain()
=============== =============== =============== =============== ==
=============== =My code=========== =============== =====
Private Sub BUpdate_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles BUpdate.Click
Dim DBPath As String
Dim SQLUpdate, a As String
DBPath = "C:\Inetpub\www root\CMS\cms.md b"
SQLUpdate = "Update client_list Set HKID='" & Me.TBHKID.Text &
"',CLIENT_N AME = '" & Me.TBClientName .Text & "' ,ADDRESS='" &
Me.TBAddress.Te xt & "',SEX='" & Me.DDLSex.Selec tedItem.Text &
"',TELEPHON E='" & Me.TBTelephone. Text & "',DATE_OF_BIRT H='" &
Me.TBDirth.Text & "',EMAIL='" & Me.TBEmail.Text & "' Where CLIENT_ID =
'John'" ',HKID='" & Me.TBHKID.Text & "',ADDRESS= '" & Me.TBAddress.Te xt
& "',SEX='" & Me.DDLSex.Selec tedItem.Text & "',TELEPHON E='" &
Me.TBTelephone. Text & "',DATE_OF_BIRT H='" & Me.TBDirth.Text &
"',EMAIL='" & Me.TBEmail.Text & "' "
Dim connStr As String = "Provider=micro soft.Jet.OLEDB. 4.0;Data
Source=" & DBPath & ""
Dim conn As System.Data.Ole Db.OleDbConnect ion
Dim cmd As System.Data.Ole Db.OleDbCommand
conn = New System.Data.Ole Db.OleDbConnect ion(connStr)
conn.Open()
cmd = New System.Data.Ole Db.OleDbCommand (SQLUpdate, conn)
L.Text = cmd.ExecuteNonQ uery()
conn.Close()
End Sub
=============== =============== =======
anyone can help me
THX