| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 543 人关注过本帖
标题:请问为什么会出现“一个参数的值没有指定”
只看楼主 加入收藏
tf2199
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-4-19
收藏
 问题点数:0 回复次数:2 
请问为什么会出现“一个参数的值没有指定”

<%@ import namespace="system.data" %>
<%@ import namespace="system.data.oledb" %>
<%@ Page Language="vb" Debug="true" %>

<script language="vb" runat="server">
sub page_load(sender as object,e as eventargs)
if not page.ispostback then
list.visible=true
info.visible=false
end if
end sub
sub retrieve()
dim conn as oledbconnection
conn=new oledbconnection
conn.connectionstring="provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("mylist.mdb")
conn.open
dim da as oledbdataadapter
dim sqlstr as string
sqlstr="select * from userinfo where username='" & username.text & "' and password='" & password.text & "'"
da=new oledbdataadapter(sqlstr,conn)
dim ds as new dataset()
da.fill(ds,"info2")
dim dt as datatable
dt=ds.tables("info2")
if dt.rows.count=1 then
dim dv as dataview=dt.defaultview
display.datasource=dv
display.databind()
list.visible=false
info.visible=true
else
response.Write("输入有误,请重试!")
end if
conn.close
end sub
sub button1_click(sender as object,e as eventargs)
retrieve()
end sub
sub datalist_itemcommand(sender as object, e as datalistcommandeventargs)
info.visible=true
list.visible=false
select case e.commandsource.text
case "用户信息"
display.selectedindex=e.item.itemindex
retrieve()
case "关闭"
display.selectedindex=-1
retrieve()
case "修改信息"
display.edititemindex=e.item.itemindex
retrieve()
case "更新"
dim passwd,repwd,email1,addr1,phone1 as string
dim tt as textbox
tt=e.item.findcontrol("pwd")
passwd=tt.text
tt=e.item.findcontrol("pwd2")
repwd=tt.text
tt=e.item.findcontrol("email")
email1=tt.text
tt=e.item.findcontrol("phone")
phone1=tt.text
tt=e.item.findcontrol("addr")
addr1=tt.text
if strcomp(passwd,repwd) then
response.write("请重新输入密码!")
else
dim conn as oledbconnection
conn=new oledbconnection
conn.connectionstring="provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("mylist.mdb")
conn.open
dim cd as oledbcommand
dim sqlstr as string
sqlstr="update userinfo set [password]='" & passwd & "',"
sqlstr &="email='" & email1 & "',addr1='" & addr1 & "',phone='"
sqlstr &=phone1 & "' where username='" & username.text & "'"
cd=new oledbcommand(sqlstr,conn)
cd.executenonquery()
response.write("<p>更新成功!<p>")
conn.close
display.edititemindex=-1
display.selectedindex=e.item.itemindex
retrieve()
end if
case "取消"
display.edititemindex=-1
retrieve()
end select
end sub
</script>

搜索更多相关主题的帖子: 参数 
2006-04-19 19:26
ming206
Rank: 2
来 自:重庆
等 级:等待验证会员
威 望:3
帖 子:545
专家分:7
注 册:2005-8-2
收藏
得分:0 
你这是.net跑来这里发干什么?
不过为什么不发方法封装起来呢?
如果这样写在WEB页面上和ASP有什么区别?
呵呵,可能用C#写会更好.

外贸综合平台:E贸通
2006-04-20 03:47
tf2199
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-4-19
收藏
得分:0 

呵呵,多谢大虾提醒,
不过此问题已经解决,不是脚本错误,是数据库没设置对,对各位带来麻烦对不起了。


2006-04-20 08:28
快速回复:请问为什么会出现“一个参数的值没有指定”
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015541 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved