Imports System.Data.SqlClient
Public Class frmKeFangInfo
Dim flag As String = ""
Private Sub SetControlDisable()
GroupBox1.Enabled = False
End Sub
Private Sub SetControlEnable()
GroupBox1.Enabled = True
End Sub
Private Sub SetControlEmpty()
txtBianHao.Text = ""
cmbLeiXing.Text = ""
txtBedTotal.Text = ""
txtMoney.Text = ""
txtDetail.Text = ""
txtMemo.Text = ""
End Sub
Dim conn As SqlConnection = GetConnection()
Dim strSql As String = "Select * From 客房信息"
Dim myda As New SqlDataAdapter(strSql, conn)
Dim mydt As DataTable
'使用dataview定制从数据库返回的、存储在DataSet中的记录的视图
Dim myDataView As DataView
'CurrencyManager用于控制绑定数据
Dim bmdata As CurrencyManager
'数据填充并更新显示过程
Private Sub FillDataSetAndView()
mydt = New DataTable
myda.Fill(mydt)
'将表填入dataview
myDataView = New DataView(mydt)
'将DataView变量绑定控件,能记录位置
bmdata = Me.BindingContext(myDataView)
End Sub
Private Sub BindingFields()
txtBianHao.DataBindings.Clear()
cmbLeiXing.DataBindings.Clear()
txtBedTotal.DataBindings.Clear()
txtMoney.DataBindings.Clear()
txtDetail.DataBindings.Clear()
txtMemo.DataBindings.Clear()
txtBianHao.DataBindings.Add("text", myDataView, "客房编号")
cmbLeiXing.DataBindings.Add("text", myDataView, "客房类型")
txtBedTotal.DataBindings.Add("text", myDataView, "总床位数")
txtMoney.DataBindings.Add(&#
Visual Basic 2010 数据库开发之酒店管理系统03客房信息设置
最新推荐文章于 2024-01-10 16:28:55 发布
本文介绍了使用Visual Basic 2010进行酒店管理系统开发,重点讲解如何设置和管理客房信息,包括数据结构设计、数据库交互及用户界面实现等关键步骤。
摘要由CSDN通过智能技术生成