[VB.NET]请问一个页面后台中 进行2次数据库读取 上下之间的值怎么传 在线等!!!!!

前端之家收集整理的这篇文章主要介绍了[VB.NET]请问一个页面后台中 进行2次数据库读取 上下之间的值怎么传 在线等!!!!!前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
请问一个页面后台中 进行2次数据库读取 上下之间的值怎么传 在线等!!!!! 就像着样 Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles MyBase.Load idd = CInt(Request( "companyid ")) If Not IsPostBack Then gstp() End If mycmd = New sqlCommand( "Select * from CompanyContent where companyid= " & idd,myconn) myconn.Open() dtr = mycmd.ExecuteReader() While dtr.Read() user_id = dtr( "user_id ").ToString companyname = dtr( "companyname ").ToString companyaddress = dtr( "companyaddress ").ToString companyLxr = dtr( "companyLxr ").ToString companytel = dtr( "companytel ").ToString MlbigClassName = dtr( "MlbigClassName ").ToString Companyms = dtr( "Companyms ").ToString Companyfw = dtr( "Companyfw ").ToString Companygm = dtr( "Companygm ").ToString Companykz = dtr( "Companykz ").ToString Companyyye = dtr( "Companyyye ").ToString Companydjg = dtr( "Companydjg ").ToString Companyyx = dtr( "Companyyx ").ToString Companymj = dtr( "Companymj ").ToString Companycz = dtr( "Companycz ").ToString Companydd = dtr( "Companydd ").ToString Companyyb = dtr( "Companyyb ").ToString zichan = dtr( "zichan ").ToString fuzai = dtr( "fuzai ").ToString Companysj = dtr( "Companysj ").ToString Companyyy = dtr( "Companyyy ").ToString Companyfr = dtr( "Companyfr ").ToString Companylx = dtr( "Companylx ").ToString companyweb = dtr( "companyweb ").ToString Companysw = dtr( "Companysw ").ToString Companykhyh = dtr( "Companykhyh ").ToString Companyyhzh = dtr( "Companyyhzh ").ToString Companyzy = dtr( "Companyzy ").ToString Companyzc = dtr( "Companyzc ").ToString cln = dtr( "cln ").ToString cly = dtr( "cly ").ToString clr = dtr( "clr ").ToString Companyrs = dtr( "Companyrs ").ToString Companygsjj = dtr( "Companygsjj ").ToString Companyjy = dtr( "Companyjy ").ToString End While dtr.Close() myconn.Close() End Sub Sub gstp() ids = (Convert.ToString(Request.QueryString( "user_id "))) Dim dtr As sqlDataReader Dim mycmd As sqlCommand Dim myconn As sqlConnection = New sqlConnection(ConfigurationSettings.AppSettings( "connectionString ")) mycmd = New sqlCommand( "Select * from gstp where user_id= '' " & ids & " '' ",myconn) myconn.Open() dtr = mycmd.ExecuteReader() While dtr.Read() pic = dtr( "pic ").ToString End While dtr.Close() myconn.Close() End Sub End Class 下面的gstp里怎么读取上面的user_id的值 谢谢. __________________________________________________________________________ 把他保存到比如Session中,在第一次就Session[ "user_id "]=123 下面就可读取了. __________________________________________________________________________ 原文链接:https://www.f2er.com/vb/263893.html

猜你在找的VB相关文章