求助!UPDATE 语句的语法错误问题
下面是错误代码!Private Sub DataGrid_Update(Sender As Object,e As DataGridCommandEventArgs)
Dim a1,a3,a4,a5,a6,a7,a8 as String
Dim strSQL as String
Dim tempTextBox AS TextBox
a1 = e.Item.Cells(1).text
tempTextBox =e.Item.Cells(3).Controls(0)
a3 = tempTextBox.Text
tempTextBox=e.Item.Cells(4).Controls(0)
a4 = tempTextBox.Text
tempTextBox=e.Item.Cells(5).Controls(0)
a5 = tempTextBox.Text
tempTextBox=e.Item.Cells(6).Controls(0)
a6 = tempTextBox.Text
tempTextBox=e.Item.Cells(7).Controls(0)
a7 = tempTextBox.Text
tempTextBox=e.Item.Cells(8).Controls(0)
a8 = tempTextBox.Text
strSQL="Update 用户信息表 set e-mail=" & a3 & ",The_person_annoy=" & a4 & ",Reputation=" & a5 & ",Article_amount=" & a6 & ",Webmaster=" & a7 & ",Specialty_area=" & a8 & " where user_name='" & a1 & "'"
Dim myCommand as OleDbCommand=new OleDbCommand(strSQL,myConnection)
myCommand.ExecuteNonQuery()
myDataGrid.EditItemIndex = -1
Call BindGrid
end sub
下面是出错信息!有能力的帮我处理下!
“/web”应用程序中的服务器错误。
--------------------------------------------------------------------------------
UPDATE 语句的语法错误。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.OleDb.OleDbException: UPDATE 语句的语法错误。
源错误:
只有在调试模式下进行编译时,生成此未处理异常的源代码才会显示出来。若要启用此功能,请执行以下步骤之一,然后请求 URL:
1. 在产生错误的文件的顶部添加一条“Debug=true”指令。例如:
<%@ Page Language="C#" Debug="true" %>
或:
2. 将以下的节添加到应用程序的配置文件中:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
请注意,第二个步骤将使给定应用程序中的所有文件在调试模式下进行编译;第一个步骤仅使该特定文件在调试模式下进行编译。
重要事项: 以调试模式运行应用程序一定会产生内存/性能系统开销。在部署到生产方案之前,应确保应用程序调试已禁用。
堆栈跟踪:
[OleDbException (0x80040e14): UPDATE 语句的语法错误。]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +267
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +192
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +48
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +106
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +108
ASP.glzh_aspx.DataGrid_Update(Object Sender, DataGridCommandEventArgs e) +883
System.Web.UI.WebControls.DataGrid.OnUpdateCommand(DataGridCommandEventArgs e) +105
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e) +471
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e) +117
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102