System.Data.OleDb.OleDbException: INSERT INTO 语句的语法错误。
我做管理员登陆也的时候出现这个System.Data.OleDb.OleDbException:INSERTINTO语句的语法错误。在System.Data.OleDb....
我做管理员登陆也的时候出现这个
System.Data.OleDb.OleDbException: INSERT INTO 语句的语法错误。
在 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()
在 DreamweaverCtrls.DataSet.DoInit()
以下是我的页面上面的代码
<%@ Page Language="VB" ContentType="text/html" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO User (AdminName, AdminPws) VALUES (?, ?)" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_webdata") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_webdata") %>'
Expression='<%# Request.Form("MM_insert") = "form1" %>'
CreateDataSet="false"
Debug="true"
>
<Parameters>
<Parameter Name="@AdminName" Value='<%# IIf((Request.Form("AdminName") <> Nothing), Request.Form("AdminName"), "") %>' Type="WChar" />
<Parameter Name="@AdminPws" Value='<%# IIf((Request.Form("AdminPws") <> Nothing), Request.Form("AdminPws"), "") %>' Type="WChar" />
</Parameters>
</MM:Insert>
<MM:DataSet
id="User"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_webdata") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_webdata") %>'
CommandText='<%# "SELECT * FROM [User] WHERE AdminName = ?" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@AdminName" Value='<%# IIf((Request.Form("AdminName") <> Nothing), Request.Form("AdminName"), "") %>' Type="WChar" />
<Parameter Name="@AdminPws" Value='<%# IIf((Request.Form("AdminPws") <> Nothing), Request.Form("AdminPws"), "0") %>' Type="WChar" />
</Parameters>
</MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Label1.visible="false"
if User.recordcount>0 then
session("User")=request.form("AdminName")
response.Redirect("index.aspx")
end if
End Sub
Sub sub_ling(Src As Object, E As EventArgs)
Label1.Visible="True"
End Sub
</script> 展开
System.Data.OleDb.OleDbException: INSERT INTO 语句的语法错误。
在 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()
在 DreamweaverCtrls.DataSet.DoInit()
以下是我的页面上面的代码
<%@ Page Language="VB" ContentType="text/html" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO User (AdminName, AdminPws) VALUES (?, ?)" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_webdata") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_webdata") %>'
Expression='<%# Request.Form("MM_insert") = "form1" %>'
CreateDataSet="false"
Debug="true"
>
<Parameters>
<Parameter Name="@AdminName" Value='<%# IIf((Request.Form("AdminName") <> Nothing), Request.Form("AdminName"), "") %>' Type="WChar" />
<Parameter Name="@AdminPws" Value='<%# IIf((Request.Form("AdminPws") <> Nothing), Request.Form("AdminPws"), "") %>' Type="WChar" />
</Parameters>
</MM:Insert>
<MM:DataSet
id="User"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_webdata") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_webdata") %>'
CommandText='<%# "SELECT * FROM [User] WHERE AdminName = ?" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@AdminName" Value='<%# IIf((Request.Form("AdminName") <> Nothing), Request.Form("AdminName"), "") %>' Type="WChar" />
<Parameter Name="@AdminPws" Value='<%# IIf((Request.Form("AdminPws") <> Nothing), Request.Form("AdminPws"), "0") %>' Type="WChar" />
</Parameters>
</MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Label1.visible="false"
if User.recordcount>0 then
session("User")=request.form("AdminName")
response.Redirect("index.aspx")
end if
End Sub
Sub sub_ling(Src As Object, E As EventArgs)
Label1.Visible="True"
End Sub
</script> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询