T
thangchan
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.OleDb.OleDbException:
無值æä¾›çµ¦ä¸€æˆ–多個必è¦åƒæ•¸ã€‚
Source Error:
Line 86: 'cmd.CommandText = "update client_list Set CLIENT_NAME
= '" & a & "' Where CLIENT_ID = 'John'"
Line 87: 'cmd.Connection = conn
Line 88: L.Text = cmd.ExecuteNonQuery()
Line 89: conn.Close()
Line 90:
Source File: c:\inetpub\wwwroot\CMS\UserDetail.aspx.vb Line: 88
Stack Trace:
[OleDbException (0x80040e10):
無值æä¾›çµ¦ä¸€æˆ–多個必è¦åƒæ•¸ã€‚]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32
hr)
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
executeResult)
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
behavior, Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
CMS.UserDetail.BUpdate_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\CMS\UserDetail.aspx.vb:88
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
==============================================================
================My code===============================
Private Sub BUpdate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BUpdate.Click
Dim DBPath As String
Dim SQLUpdate, a As String
DBPath = "C:\Inetpub\wwwroot\CMS\cms.mdb"
SQLUpdate = "Update client_list Set HKID='" & Me.TBHKID.Text &
"',CLIENT_NAME = '" & Me.TBClientName.Text & "' ,ADDRESS='" &
Me.TBAddress.Text & "',SEX='" & Me.DDLSex.SelectedItem.Text &
"',TELEPHONE='" & Me.TBTelephone.Text & "',DATE_OF_BIRTH='" &
Me.TBDirth.Text & "',EMAIL='" & Me.TBEmail.Text & "' Where CLIENT_ID =
'John'" ',HKID='" & Me.TBHKID.Text & "',ADDRESS='" & Me.TBAddress.Text
& "',SEX='" & Me.DDLSex.SelectedItem.Text & "',TELEPHONE='" &
Me.TBTelephone.Text & "',DATE_OF_BIRTH='" & Me.TBDirth.Text &
"',EMAIL='" & Me.TBEmail.Text & "' "
Dim connStr As String = "Provider=microsoft.Jet.OLEDB.4.0;Data
Source=" & DBPath & ""
Dim conn As System.Data.OleDb.OleDbConnection
Dim cmd As System.Data.OleDb.OleDbCommand
conn = New System.Data.OleDb.OleDbConnection(connStr)
conn.Open()
cmd = New System.Data.OleDb.OleDbCommand(SQLUpdate, conn)
L.Text = cmd.ExecuteNonQuery()
conn.Close()
End Sub
=====================================
anyone can help me
THX
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.OleDb.OleDbException:
無值æä¾›çµ¦ä¸€æˆ–多個必è¦åƒæ•¸ã€‚
Source Error:
Line 86: 'cmd.CommandText = "update client_list Set CLIENT_NAME
= '" & a & "' Where CLIENT_ID = 'John'"
Line 87: 'cmd.Connection = conn
Line 88: L.Text = cmd.ExecuteNonQuery()
Line 89: conn.Close()
Line 90:
Source File: c:\inetpub\wwwroot\CMS\UserDetail.aspx.vb Line: 88
Stack Trace:
[OleDbException (0x80040e10):
無值æä¾›çµ¦ä¸€æˆ–多個必è¦åƒæ•¸ã€‚]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32
hr)
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
executeResult)
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
behavior, Object& executeResult)
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
CMS.UserDetail.BUpdate_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\CMS\UserDetail.aspx.vb:88
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
==============================================================
================My code===============================
Private Sub BUpdate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BUpdate.Click
Dim DBPath As String
Dim SQLUpdate, a As String
DBPath = "C:\Inetpub\wwwroot\CMS\cms.mdb"
SQLUpdate = "Update client_list Set HKID='" & Me.TBHKID.Text &
"',CLIENT_NAME = '" & Me.TBClientName.Text & "' ,ADDRESS='" &
Me.TBAddress.Text & "',SEX='" & Me.DDLSex.SelectedItem.Text &
"',TELEPHONE='" & Me.TBTelephone.Text & "',DATE_OF_BIRTH='" &
Me.TBDirth.Text & "',EMAIL='" & Me.TBEmail.Text & "' Where CLIENT_ID =
'John'" ',HKID='" & Me.TBHKID.Text & "',ADDRESS='" & Me.TBAddress.Text
& "',SEX='" & Me.DDLSex.SelectedItem.Text & "',TELEPHONE='" &
Me.TBTelephone.Text & "',DATE_OF_BIRTH='" & Me.TBDirth.Text &
"',EMAIL='" & Me.TBEmail.Text & "' "
Dim connStr As String = "Provider=microsoft.Jet.OLEDB.4.0;Data
Source=" & DBPath & ""
Dim conn As System.Data.OleDb.OleDbConnection
Dim cmd As System.Data.OleDb.OleDbCommand
conn = New System.Data.OleDb.OleDbConnection(connStr)
conn.Open()
cmd = New System.Data.OleDb.OleDbCommand(SQLUpdate, conn)
L.Text = cmd.ExecuteNonQuery()
conn.Close()
End Sub
=====================================
anyone can help me
THX