如何使用Vb.Net的语言在Asp.Net中使用Fileupload?使用Access Data Base 2003 [英] How Do I Use Fileupload In Asp.Net With The Language Of Vb.Net? With Access Data Base 2003
问题描述
这里宣布像文本框和按钮这样的工具..
<< pre lang =xml >%@ Page Language =VBAutoEventWireup =falseCodeFile =Main.aspx.vbInherits =Main%>
< ;!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
< html xmlns =http://www.w3.org/1999/xhtml>
< head runat =server> ;
< title>< / title>
< link href =tarp.css =stylesheettype =text / css/>
< / head>
< body>
< form id =form1runat =server>
< div>
< asp:Label runat = serverID =Label1>确保填写所有字段。< / asp:标签>
< asp:标签runat =serverID =Label2>名字:< / asp:标签>
< asp:TextBox runat =serverID =FNTxtbox>< / asp:TextBox>
< asp:Label runat =server ID =Label3>姓:< / asp:标签>
< asp:TextBox runat =serverID =SNTxtbox>< / asp:TextBox>
< asp:标签runat =serverID =Label4>地址:< / asp:标签>
< asp:TextBox runat =serverID =ATxtbox>< / asp:TextBox>
< asp:Label runat =serverID = Label5>联系人#:< / asp:标签>
< asp:TextBox runat =serverID =CTxtbox>< / asp:TextBox>
< asp:Label runat =serverID =Label9>请点击选择文件选择要打印的图像。< / asp:标签>
< asp:FileUpload runat =serverID =FUTxtboxClientIDMode =AutoID/>
< ; asp:标签runat =serverID = Label7>高度:< / asp:标签>
< asp:TextBox runat =serverID =HTxtbox>< / asp:TextBox>
< asp:标签runat =服务器ID =inch1>英寸< / asp:标签>
< asp:标签runat =serverID =Label8>宽度:< / asp:标签>
< asp:TextBox runat =serverID =WTxtbox>< / asp: TextBox>
< asp:Label runat =serverID =inch2> inch< / asp:Label>
< asp:Label runat =serverID =Label6>选择完成日期!< / asp:Label>
< asp:Calendar runat =serverID =Calendar1 >< / asp:日历>
< div id =提交>
< asp:按钮runat =serverID =SBtnText =SUBMITWidth =225pxHeight =35px/>
< / div>
< div id =清除>
< asp:Button runat =serverID =CBtnText =CLEARWidth =225pxHeight =35px/>
< / div>
< / div>
< / form>
< / body>
< ; / html>
这是我的Main.ASPX.VB
Imports System.Data
Imports System.Data.OleDb
Partial Class Main
继承System.Web.UI.Page
Dim con As New OleDbConnection
Dim cmdInsert As New OleDbCommand
Protected Sub Page_Load (ByVal sender As Object,ByVal e As System.EventArgs)Handles Me.Load
con = New OleDbConnection(Provider = Microsoft.JET.OLEDB.4.0; Data来源=& Server.MapPath(App_Data / tarpaulin.mdb))
con.Open()
End Sub
受保护的子SBtn_Click(ByVal发送者为对象,ByVal e As System.EventArgs)处理SBtn.Click
Dim tarpDate As DateTime
tarpDate = Calendar1.SelectedDate
Dim FU As Image
FUTxtbox .HasFile = FU
cmdInsert =新的OleDbCommand(插入tarp(名字,姓氏,地址,Contact_Number,图像,高度,宽度,[Date_Submit])值( '& FNTxtbox.Text&','& SNTxtbox.Text&','& ATxtbox.Text&','& CTxtbox.Text&',' & FU&','& HTxtbox.Text&','& WTxtbox.Text&','& tarpDate&'),con)
cmdInsert.ExecuteNonQuery()
Response.Write(保存 )
con.Close()
结束Sub
结束课程
我的学校项目需要它。 。
我需要创建一个网站,其功能是在Access Database 2003版本中插入数据
非常感谢提前:)
上帝保佑每个人:)
推荐答案
请参阅链接
使用ASP.NET上传文件 [ ^ ]
这是在c#中,但您可以使用followg链接将c#代码转换为VB.NET
HTTP://www.developerfusio n.com/tools/convert/csharp-to-vb/ [ ^ ]
Refer the link
File Upload with ASP.NET[^]
This is in c# but you can convert the c# code to VB.NET by using followg link
http://www.developerfusion.com/tools/convert/csharp-to-vb/[^]
这篇关于如何使用Vb.Net的语言在Asp.Net中使用Fileupload?使用Access Data Base 2003的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!