sub add_click(send as object, e as eventargs)
dim conn as oledbconnection
conn = new oledbconnection()
conn.connectionstring = "provider = microsoft.jet.oledb.4.0; data source = " & Server.mapPath("user.mdb")
conn.open()
dim cd as oledbcommand
dim SqlStr as String
SqlStr = "insert into reg values('jiang','army','[email protected]','福州市','0591-6325401','男','1976/05/06')"
cd = new oledbcommand(SqlStr,conn)
cd.executeNonQuery()
response.write(sqlstr)
response.write("<p>添加成功<p>")
sqlstr = "update reg set [password] = '1234'"
cd = new oledbcommand(sqlstr,conn)
cd.executenonquery()
conn.close()
response.write("<p>更新成功<p>") end sub
我执行上面这段代码,出现如下问题:(请问专家这是怎么回事!我代码错在哪里呢?还是有其它问题)“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------至少一个参数没有被指定值。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.OleDb.OleDbException: 至少一个参数没有被指定值。源错误: 生成此未处理异常的源代码只能在调试模式中进行编译时显示。若要启用该功能,请执行以下步骤之一,然后请求 URL:1. 在生成错误的文件的顶部添加一个“Debug=true”指令。示例: <%@ Page Language="C#" Debug="true" %>或者:2. 将以下节添加到应用程序的配置文件中:<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>请注意,第二种方法将使给定应用程序中的所有文件在调试模式下进行编译。第一种方法只使特定文件在调试模式下进行编译。重要事项:以调试模式运行应用程序肯定会引起内存/性能系统开销。在部署到产品方案中之前,应该确保应用程序已禁用调试。 堆栈跟踪:
[OleDbException (0x80040e10): 至少一个参数没有被指定值。]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) +41
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +174
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +92
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +65
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +112
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +67
ASP.default_aspx.add_click(Object send, EventArgs e) +208
System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e) +108
System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1277请您帮帮我,在线等
dim conn as oledbconnection
conn = new oledbconnection()
conn.connectionstring = "provider = microsoft.jet.oledb.4.0; data source = " & Server.mapPath("user.mdb")
conn.open()
dim cd as oledbcommand
dim SqlStr as String
SqlStr = "insert into reg values('jiang','army','[email protected]','福州市','0591-6325401','男','1976/05/06')"
cd = new oledbcommand(SqlStr,conn)
cd.executeNonQuery()
response.write(sqlstr)
response.write("<p>添加成功<p>")
sqlstr = "update reg set [password] = '1234'"
cd = new oledbcommand(sqlstr,conn)
cd.executenonquery()
conn.close()
response.write("<p>更新成功<p>") end sub
我执行上面这段代码,出现如下问题:(请问专家这是怎么回事!我代码错在哪里呢?还是有其它问题)“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------至少一个参数没有被指定值。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.OleDb.OleDbException: 至少一个参数没有被指定值。源错误: 生成此未处理异常的源代码只能在调试模式中进行编译时显示。若要启用该功能,请执行以下步骤之一,然后请求 URL:1. 在生成错误的文件的顶部添加一个“Debug=true”指令。示例: <%@ Page Language="C#" Debug="true" %>或者:2. 将以下节添加到应用程序的配置文件中:<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>请注意,第二种方法将使给定应用程序中的所有文件在调试模式下进行编译。第一种方法只使特定文件在调试模式下进行编译。重要事项:以调试模式运行应用程序肯定会引起内存/性能系统开销。在部署到产品方案中之前,应该确保应用程序已禁用调试。 堆栈跟踪:
[OleDbException (0x80040e10): 至少一个参数没有被指定值。]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) +41
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +174
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +92
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +65
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +112
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +67
ASP.default_aspx.add_click(Object send, EventArgs e) +208
System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e) +108
System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1277请您帮帮我,在线等
<%@ Page Language="C#" Debug="true" %>
看详细的错误信息是什么
不知道你的表结构,你自己查查看,把缺的字段加上去。估计是缺了密码。
他用的是VB.Net
--------------------------------------------------------------------------------分析器错误
说明: 在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。 分析器错误信息: 由于先前已在此页中指定了另一种语言,因此不能使用“vb”。源错误:
行 6:
行 7:
行 8: <script language="vb" runat="server">
行 9:
行 10:
字段名 数据类型
fname 文本
lname 文本
email 文本
city 文本
tel 文本
sex 文本
data 文本
没有密码字段啊。
下面这段是删除表记录代码和查找代码,都没有问题:
sub del_click(send as object, e as eventargs)
dim conn as oledbconnection
conn = new oledbconnection()
conn.connectionstring = "provider = microsoft.jet.oledb.4.0; data source = " & _ Server.mapPath("user.mdb")
conn.open()
dim cd as oledbcommand
dim SqlStr as String
SqlStr = "delete from reg where fname= 'jiang'"
cd = new oledbcommand(SqlStr,conn)
cd.executeNonQuery()
conn.close()
response.write(sqlstr)
response.write("<p>删除成功<p>")
end sub sub ser_click(send as object, e as eventargs)
dim conn as oledbconnection
conn = new oledbconnection()
conn.connectionstring = "provider = microsoft.jet.oledb.4.0; data source = " & _ Server.mapPath("user.mdb")
conn.open()
dim cmd as oledbcommand
cmd = new oledbcommand("select * from reg", conn)
dim rd as oledbdatareader
rd = cmd.executereader()
dim i as integer
while rd.read()
response.write("<ul>")
for i = 0 to rd.fieldcount - 1
response.write("<li>" & rd.getname(i) & "=" & rd.item(i))
next
response.write("</ul>")
end while
表 字段 修改的值 后面自己看了。
我刚刚接触asp.net我学过VB,可是都好久没有用了!谢谢你哦!我的QQ是52555897 希望以后能常和你联系