您目前尚未登陆,请选择【登陆】或【注册
首页->全站代码->汽车配件公司网站(VB.net+Access数据库)源码>>add_pic.aspx.vb>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:汽车配件公司网站(VB.net+Access数据库)源码
当前文件:文件类型 VbNetCompany/add_pic.aspx.vb打开代码结构图
普通视图
		            
1Imports System 2Imports System.Data 3Imports System.Configuration 4Imports System.Collections 5Imports System.Web 6Imports System.Web.Security 7Imports System.Web.UI 8Imports System.Web.UI.WebControls 9Imports System.Web.UI.WebControls.WebParts 10Imports System.Web.UI.HtmlControls 11Imports System.Data.SqlClient 12Imports System.Data.OleDb 13 14Public Partial Class add_pic 15 Inherits System.Web.UI.Page 16 Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) 17 If Session("loginname") Is Nothing OrElse Session("loginname").ToString() = "" Then 18 Response.Write("<script>alert('用户登录时间超时,请重新登录');document.location='admin.aspx'</script>") 19 Response.[End]() 20 End If 21 22 Try 23 24 Using oleconn As New OleDbConnection() 25 oleconn.ConnectionString = ConfigurationManager.ConnectionStrings("oleConnectionString").ConnectionString 26 oleconn.Open() 27 Dim adapter As New OleDbDataAdapter() 28 adapter.SelectCommand = New OleDbCommand("select * from picclass", oleconn) 29 Dim DataSet1 As New System.Data.DataSet() 30 adapter.Fill(DataSet1, "picclass") 31 DropDownList1.DataSource = DataSet1.Tables("picclass").DefaultView 32 DropDownList1.DataTextField = "pic_class" 33 DropDownList1.DataValueField = "pic_class" 34 DropDownList1.DataBind() 35 36 oleconn.Close() 37 38 oleconn.Dispose() 39 End Using 40 Catch err As Exception 41 Dim str As String = err.Message.Replace("'", "") 42 Response.Write("<script>alert('" + str + "');</script>") 43 End Try 44 End Sub 45 46 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) 47 If Session("loginname") Is Nothing OrElse Session("loginname").ToString() = "" Then 48 Response.Write("<script>alert('用户登录时间超时,请重新登录');document.location='admin.aspx'</script>") 49 Response.[End]() 50 End If 51 Try 52 Dim user_name1 As String = "" 53 Dim user_title1 As String = "" 54 Dim user_text1 As String = "" 55 56 Using oleconn As New OleDbConnection() 57 oleconn.ConnectionString = ConfigurationManager.ConnectionStrings("oleConnectionString").ConnectionString 58 oleconn.Open() 59 60 Dim strSQL As String = "Insert INTO pic(pic_name,pic_type,pic_class,pic_text,pic_url,pic_lurl) Values('" + pic_name.Text + "','" + pic_type.Text + "','" + DropDownList1.SelectedValue + "','" + pic_text.Text + "','" + pic_url.Text + "','" + pic_lurl.Text + "')" 61 Dim command As New OleDbCommand(strSQL, oleconn) 62 command.ExecuteNonQuery() 63 64 oleconn.Close() 65 oleconn.Dispose() 66 Response.Write("<script language='javascript'>window.confirm('产品已经成功添加!!');</script>") 67 Response.Write("<script language='javascript'>parent.window.history.go(-1);</script>") 68 End Using 69 70 Catch err As Exception 71 Dim str As String = err.Message.Replace("'", "") 72 Response.Write("<script>alert('" + str + "');</script>") 73 End Try 74 75 End Sub 76End Class
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:汽车配件公司网站(VB.net+Access数据库)源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号