[摘要]4、 声明类级的变量。找到设计期产生的代码部分,把下面的语句加到变量声明后面。什么?不知道变量声明在哪儿?不会吧!Private fs As FileStream Private ds A... 4、 声明类级的变量。找到设计期产生的代码部分,把下面的语句加到变量声明后面。什么?不知道变量声明在哪儿?不会吧!
Private fs As FileStream
Private ds As DataSet
Private conn As New SqlConnection("server=localhost;database=northwind;integrated security=true;")
Private currentpos As Integer = 9
5、 开始写代码了。首先是form_load
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
btnOpen.Enabled = True
btnSave.Enabled = True
btnBack.Enabled = False
btnForward.Enabled = False
End Sub
6、 open按钮的点击事件代码:
Private Sub openbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpen.Click
Dim Opendlg As New OpenFileDialog
Opendlg.Title = "Select a picture file"
Opendlg.Filter = "(*.bmp) |
关键词: Vb.net向sql server数据库中保存图片(二)