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 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
返回消息框证实增加数量。
图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
- ››Pcworld:Windows 7三则常见故障排除技巧
- ››应用程序的配置管理Poco
- ››PC免疫系统 IFN-RE53
- ››Pocket Player睡眠定时器不能选择问题的解决办法
- ››PocketPC下 创建全屏幕应用程序
- ››PC上试玩Android Market
- ››应用程序开发者偏好苹果也关注Android
- ››PC World:Android与iPhone手机的五大战场
- ››PC通过Android上网的几种方法总结
- ››PCWorld:IE9“平台预览版”你问我答
- ››Pocket PC 智能手机 Windows 根目录下自带程序名称...
- ››Pcworld:升级至Office 2010的八点须知
赞助商链接