16,555
社区成员
发帖
与我相关
我的任务
分享
dim SqlStr="select * from [User] where 用户名= '@用户名'"
dim Conn as new sqlconnection
dim ds as new dataset
usering conn as new sqlconnection(MyData.conStr)
try
conn.open()
dim cmd as new sqlcommand(SQLstr,conn)
cmd.parameters.addwithvalue("@用户名",UserName)
cmd.commandtext =sqlstr
dim da as new sqldataadapter(SqlStr,conn)
da.fill(ds)
'do....
cathch ex as exception
debug.pring(ex.tostring)
finally
conn.close()
end try