asp.net中运行页面时提示错误为:用户代码未处理Oledbexception 还有是:至少一个参数没有被指定急急急!!
SubBindGrid(byvaltjasstring,byvalnrasstring)DimStrCnnAsStringDimCnnAsOleDbConnectionD...
Sub BindGrid(byval tj as string,byval nr as string)
Dim StrCnn As String
Dim Cnn As OleDbConnection
Dim Cmd As OleDbCommand
dim dtcmd as oledbdataadapter
dim dt as new datatable
dim str2 as string
dim Str1 as string
if trim(tj)<>"" and trim(nr)<>"" then
str1=" where " & tj & " like '%" & trim(nr) & "%'"
end if
StrCnn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Music.mdb")
Cnn=New OleDbConnection(StrCnn)
Cnn.Open()
str1="select id,songname,songer,addr,zj from music " & str1 & " order by id desc"
dtcmd=new oledbdataadapter(str1,cnn)
dtcmd.fill(dt) 至少有一个参数没被指定怎么回事啊?
datagrid1.datasource=dt
datagrid1.databind()
cnn.close()
End Sub 展开
Dim StrCnn As String
Dim Cnn As OleDbConnection
Dim Cmd As OleDbCommand
dim dtcmd as oledbdataadapter
dim dt as new datatable
dim str2 as string
dim Str1 as string
if trim(tj)<>"" and trim(nr)<>"" then
str1=" where " & tj & " like '%" & trim(nr) & "%'"
end if
StrCnn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Music.mdb")
Cnn=New OleDbConnection(StrCnn)
Cnn.Open()
str1="select id,songname,songer,addr,zj from music " & str1 & " order by id desc"
dtcmd=new oledbdataadapter(str1,cnn)
dtcmd.fill(dt) 至少有一个参数没被指定怎么回事啊?
datagrid1.datasource=dt
datagrid1.databind()
cnn.close()
End Sub 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询