开发学院数据库MSSQL Server Pocket PC应用程序中使用SQL Server CE 阅读

Pocket PC应用程序中使用SQL Server CE

 2009-02-07 10:20:39 来源:WEB开发网   
核心提示: Private Sub cmdAdd_Click( ByVal sender As System.Object,ByVal e As System.EventArgs) _Handles cmdAdd.Click'---add the title to the stores ORD

Private Sub cmdAdd_Click( ByVal sender As System.Object,ByVal e As System.EventArgs) _
Handles cmdAdd.Click
'---add the title to the stores ORDER table
conn.Open()
Dim sql As String = "INSERT INTO Orders " &_
"(storeID, title_id, Qty) VALUES (" & _
cboStoreID.Items(cboStoreID.SelectedIndex) _
& ",'" & _
lblTitleID.Text & "'," & txtQty.Text & ")"
Dim cmd As New SqlCeCommand(sql, conn)
cmd.ExecuteNonQuery()
MsgBox("Title added for " & lblStoreName.Text, _
MsgBoxStyle.Information, "Orders")
conn.Close()
End Sub

返回消息框证实增加数量。

Pocket PC应用程序中使用SQL Server CE

图7

审核订单

点击第二个tab页显示订单,点击Refresh按钮第一个ListBox控件将显示订单。

Private Sub cmdRefresh_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles cmdRefresh.Click
'---displays the list of stores available
conn.Open()
Dim sql As String = "SELECT * FROM Stores"
Dim cmd As New SqlCeCommand(sql, conn)
Dim reader As SqlCeDataReader = _
cmd.ExecuteReader
'---clears the listbox
cboStoreIDs.Items.Clear()
While reader.Read()
cboStoreIDs.Items.Add( _
reader.Item("storeID"))
End While
conn.Close()
End Sub

上一页  1 2 3 4 5 6 7  下一页

Tags:Pocket PC 应用程序

编辑录入:爽爽 [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接