用SQL Server Compact Edition创建移动应用程序
此演练将介绍如何在使用 Microsoft SQL Server 2005 Compact Edition 的 Microsoft Visual Studio 2005 中 创建 应用 程序 。SQL Server Compact Edition 数据库将成为 SQL Server 2005 发布的订阅服务器,并且将使用合并复制从 SQL Server 2005 数据库中将
此演练将介绍如何在使用 Microsoft SQL Server 2005 Compact Edition 的 Microsoft Visual Studio 2005 中创建应用程序。SQL Server Compact Edition 数据库将成为 SQL Server 2005 发布的订阅服务器,并且将使用合并复制从 SQL Server 2005 数据库中将信息下载到 SQL Server Compact Edition 数据库。
- 在此演练中,您将执行下列步骤:
- 配置 SQL Server 2005 发布。
- 配置 Internet 信息服务 (IIS) 以进行复制。
- 创建 SQL Server Compact Edition 订阅。
- 创建应用程序。
- 部署应用程序并测试订阅。
必备项
若要按照此演练中所写的步骤执行此演练,则必须满足下列条件:
- 安装有 Windows XP 和 IIS 的计算机。
- SQL Server 2005 Service Pack 2 (SP2) 或更高版本,与 Visual Studio 安装在同一台计算机上。
SQL Server 2005 任务
在创建应用程序之前,必须在 SQL Server 2005 中配置发布。在下列步骤中,您将创建一个示例数据库,然后从该数据库发布数据。您将使用预建的脚本文件创建数据库,然后使用新建发布向导来创建发布。
创建数据库并在其中填充数据
1、打开 SQL Server Management Studio。
2、当提示您连接服务器时,请在“服务器名称”中键入 (local),然后单击“连接”。
3、打开一个新查询窗口。创建 SQL Server Compact Edition 数据库,并用数据填充该数据库。
以下是引用片段: USE master; GO IF EXISTS (SELECT * FROM sys.sysdatabases WHERE name = 'SQLMobile') BEGIN DROP Database SQLMobile; END GO CREATE DATABASE SQLMobile; GO USE SQLMobile; GO CREATE TABLE MembershipData (MemberID INTEGER IDENTITY (1,1) CONSTRAINT pkMemberID PRIMARY KEY, MemberName NVarChar (50)); CREATE TABLE FlightData (MemberID INTEGER FOREIGN KEY REFERENCES MembershipData(MemberID), Destination NVarChar (50), FlightStatus NVarChar(50), ArrivalDate DATETIME, FlownMiles INTEGER); INSERT INTO MembershipData (MemberName) VALUES ('Mr Don Hall'); INSERT INTO MembershipData (MemberName) VALUES ('Mr Jon Morris'); INSERT INTO MembershipData (MemberName) VALUES ('Ms TiAnna Jones'); INSERT INTO FlightData (MemberID, Destination, FlightStatus, ArrivalDate, FlownMiles) VALUES (1, 'Seattle', 'Flight Delayed 1 hour', '8/25/00', '20000'); INSERT INTO FlightData (MemberID, Destination, FlightStatus, ArrivalDate, FlownMiles) VALUES (2, 'London', 'Flight on time', '9/12/00', '15000'); INSERT INTO FlightData (MemberID, Destination, FlightStatus, ArrivalDate, FlownMiles) VALUES (3, 'Sydney', 'Flight Gate Closing', '11/5/00', '30000'); INSERT INTO FlightData (MemberID, Destination, FlightStatus, ArrivalDate, FlownMiles) VALUES (1, 'Tokyo', 'Delayed Fog', '5/25/00', '25000'); INSERT INTO FlightData (MemberID, Destination, FlightStatus, ArrivalDate, FlownMiles) VALUES (2, 'Minneapolis', 'Flight on time', '5/1/00', '1000'); INSERT INTO FlightData (MemberID, Destination, FlightStatus, ArrivalDate, FlownMiles) VALUES (3, 'Memphis', 'Flight Gate Closing', '1/5/00', '1000'); GO |
4、单击“执行(!)”运行该脚本并创建数据库。此时,将运行该脚本,创建一个名为 SQLMobile 的新数据库。
注意:
您还可以按 F5,或者从“查询”菜单中选择“执行”来运行该查询。
5、若要确认该数据库已创建,请在对象资源管理器中,展开“(本地)”,展开“数据库”,然后展开“SQLMobile”。如果没有列出 SQLMobile 数据库。请右键单击“数据库”,然后选择“刷新”以更新数据库列表。
准备服务器以发布数据
在创建发布之前,必须创建快照代理用户帐户,并创建一个将在其中存储快照文件的共享文件夹,准备服务器以进行发布。创建快照文件夹之后,该文件夹将用于服务器上的所有发布。如果以前已在此服务器上创建了发布,您可以跳过这些步骤。
创建快照用户帐户
1、从“控制面板”的“管理工具”中打开“计算机管理”。
2、在“计算机管理”中,展开“系统工具”,展开“本地用户和组”,右键单击“用户”,然后选择“新用户”。
3、在“新用户”对话框中,键入以下信息,然后单击“创建”:
字段 | 值 |
---|---|
用户名 |
snapshot_agent |
密码 |
p@ssw0rd |
确认密码 |
p@ssw0rd |
用户下次登录时须更改密码 |
未选中 |
密码永不过期 |
选中 |
重要事项:
这些设置应该仅用于测试。在生产环境中,请确保用户帐户设置符合您的网络安全要求。通常,您将对快照代理使用域用户帐户而不是使用本地用户帐户。
创建快照文件夹
- 在 Windows 资源管理器中,创建一个名为“snapshot”的新文件夹。在此演练中,您可以在驱动器 C 的根目录下创建该文件夹:c:\snapshot。右键单击“snapshot”文件夹,然后选择“共享和安全”。
- 在“共享”选项卡上,选择“共享该文件夹”,然后单击“权限”。
- 在“快照的权限”中,单击“添加”。
- 在“输入要选择的对象名称”中,键入 computername\snapshot_agent(其中 computername 为本地计算机的名称),单击“检查名称”,然后单击“确定”。
- 在“快照的权限”中,选择“snapshot_agent”,分配“更改”和“读取”共享权限,然后单击“确定”。
- 选择“安全”选项卡。
- 单击“添加”。
- 在“输入要选择的对象名称”中,键入 computername\snapshot_agent(其中 computername 为本地计算机的名称),单击“检查名称”,然后单击“确定”。
- 选择“snapshot_agent”,然后将“写入”权限添加到已启用的权限列表中。现在,snapshot_agent 帐户将被授予下列权限:
- 读取和执行
- 列出文件夹目录
- 读取
- 写入
- 单击“确定”关闭“快照属性”窗口。
- 关闭 Windows 资源管理器。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



HQL and SQL are compared in the Hibernate framework: HQL (1. Object-oriented syntax, 2. Database-independent queries, 3. Type safety), while SQL directly operates the database (1. Database-independent standards, 2. Complex executable queries and data manipulation).

Fujifilm fans were recently very excited at the prospect of the X-T50, since it presented a relaunch of the budget-oriented Fujifilm X-T30 II that had become quite popular in the sub-$1,000 APS-C category. Unfortunately, as the Fujifilm X-T50's launc

"Usage of Division Operation in OracleSQL" In OracleSQL, division operation is one of the common mathematical operations. During data query and processing, division operations can help us calculate the ratio between fields or derive the logical relationship between specific values. This article will introduce the usage of division operation in OracleSQL and provide specific code examples. 1. Two ways of division operations in OracleSQL In OracleSQL, division operations can be performed in two different ways.

The Fujifilm X-M5 has shown itself in a handful of rumours that suggested that the compact APS-C camera would launch as an affordable alternative to the X100VI sometime in late 2024. Now, a new rumour out of Fujirumours reveals Fujifilm's film simula

Oracle and DB2 are two commonly used relational database management systems, each of which has its own unique SQL syntax and characteristics. This article will compare and differ between the SQL syntax of Oracle and DB2, and provide specific code examples. Database connection In Oracle, use the following statement to connect to the database: CONNECTusername/password@database. In DB2, the statement to connect to the database is as follows: CONNECTTOdataba

What is Identity in SQL? Specific code examples are needed. In SQL, Identity is a special data type used to generate auto-incrementing numbers. It is often used to uniquely identify each row of data in a table. The Identity column is often used in conjunction with the primary key column to ensure that each record has a unique identifier. This article will detail how to use Identity and some practical code examples. The basic way to use Identity is to use Identit when creating a table.

Interpretation of MyBatis dynamic SQL tags: Detailed explanation of Set tag usage MyBatis is an excellent persistence layer framework. It provides a wealth of dynamic SQL tags and can flexibly construct database operation statements. Among them, the Set tag is used to generate the SET clause in the UPDATE statement, which is very commonly used in update operations. This article will explain in detail the usage of the Set tag in MyBatis and demonstrate its functionality through specific code examples. What is Set tag Set tag is used in MyBati

This article will interest you if you are interested in using GIMP for pixel art creation on Windows. GIMP is a well-known graphics editing software that is not only free and open source, but also helps users create beautiful images and designs easily. In addition to being suitable for beginners and professional designers alike, GIMP can also be used to create pixel art, a form of digital art that utilizes pixels as the only building blocks for drawing and creating. How to Create Pixel Art in GIMP Here are the main steps to create pixel pictures using GIMP on a Windows PC: Download and install GIMP, then launch the application. Create a new image. Resize width and height. Select the pencil tool. Set the brush type to pixels. set up
