亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? controlreplication.cs

?? 用VS。NET基于wince
?? CS
?? 第 1 頁 / 共 2 頁
字號:
                this.panelProps.Enabled = false;
                buttonSync.Text = "Synchronize";
            }
        }

        // This function loads the connection information info from the "ApplicationProperties" table.
        //
        private void LoadAppProps() {
            // Create a SqlCeCommand object associated with the connection to NorthwindDemo database.
            //
            SqlCeCommand cmd = dataNorthwind.NorthwindConnection.CreateCommand();

            // Load the connect information from the ApplicationProperties table in the NorthwindDemo database.
            //
            cmd.CommandText = @"SELECT InternetURL, InternetLogin, InternetPassword, Publisher, PublisherLogin, PublisherPassword, PublisherSecurityMode, Subscriber FROM ApplicationProperties;";

            SqlCeDataReader drAppProp = null;

            try {

                drAppProp = cmd.ExecuteReader();
                if (drAppProp.Read()) {
                    int index;

                    // Get the Internet URL data.
                    //
                    index = drAppProp.GetOrdinal("InternetURL");
                    if (!drAppProp.IsDBNull(index)) {
                        this.textBoxInternetUrl.Text = drAppProp.GetString(index);
                    }
                    else {
                        this.textBoxInternetUrl.Text = "";
                    }

                    // Get the Internet login data.
                    //
                    index = drAppProp.GetOrdinal("InternetLogin");
                    if (!drAppProp.IsDBNull(index)) {
                        this.textBoxInternetLogin.Text = drAppProp.GetString(index);
                    }
                    else {
                        this.textBoxInternetLogin.Text = "";
                    }

                    // Get the Internet password data.
                    //
                    index = drAppProp.GetOrdinal("InternetPassword");
                    if (!drAppProp.IsDBNull(index)) {
                        this.textBoxInternetPwd.Text = drAppProp.GetString(index);
                    }
                    else {
                        this.textBoxInternetPwd.Text = "";
                    }

                    // Get the publisher data.
                    //
                    index = drAppProp.GetOrdinal("Publisher");
                    if (!drAppProp.IsDBNull(index)) {
                        this.textBoxPublisher.Text = drAppProp.GetString(index);
                    }
                    else {
                        this.textBoxPublisher.Text = "";
                    }

                    // Get the publisher login data.
                    //
                    index = drAppProp.GetOrdinal("PublisherLogin");
                    if (!drAppProp.IsDBNull(index)) {
                        this.textBoxUserID.Text = drAppProp.GetString(index);
                    }
                    else {
                        this.textBoxUserID.Text = "";
                    }

                    // Get the publisher password data.
                    //
                    index = drAppProp.GetOrdinal("PublisherPassword");
                    if (!drAppProp.IsDBNull(index)) {
                        this.textBoxPassword.Text = drAppProp.GetString(index);
                    }
                    else {
                        this.textBoxPassword.Text = "";
                    }

                    // Get the publisher security mode data.
                    //
                    index = drAppProp.GetOrdinal("PublisherSecurityMode");
                    if (!drAppProp.IsDBNull(index)) {
                        this.radioButtonSQLAuth.Checked = (1 == drAppProp.GetByte(index));
                    }
                    else {
                        this.radioButtonSQLAuth.Checked = true;
                    }

                    // Get the subscriber data.
                    //
                    index = drAppProp.GetOrdinal("Subscriber");
                    if (!drAppProp.IsDBNull(index)) {
                        this.textBoxSubscriber.Text = drAppProp.GetString(index);
                    }
                    else {
                        this.textBoxSubscriber.Text = "";
                    }
                }
            }
            finally {
                drAppProp.Close();
            }
        }

        // This function saves the connecting information in the "ApplicationProperties" table.
        //
        private void SaveAppProps() 
        {
            // Create the "ApplicationProperties" table.
            //
            SqlCeCommand cmd = dataNorthwind.NorthwindConnection.CreateCommand();
            cmd.CommandText = @"CREATE TABLE ApplicationProperties (" + 
                "InternetURL NTEXT, " +
                "InternetLogin NVARCHAR(255), " +
                "InternetPassword NVARCHAR(255), " +
                "Publisher NVARCHAR(255), " +
                "PublisherLogin NVARCHAR(255), " +
                "PublisherPassword NVARCHAR(255), " +
                "PublisherSecurityMode TINYINT, " +
                "Subscriber NVARCHAR(255));";

            cmd.ExecuteNonQuery();

            // Save the connection information
            //
            cmd.CommandText = @"INSERT INTO ApplicationProperties " + 
                "(InternetURL, InternetLogin, InternetPassword, Publisher, PublisherLogin, PublisherPassword, PublisherSecurityMode, Subscriber) " +
                "VALUES (?, ?, ?, ?, ?, ?, ?, ?);";
            cmd.Parameters.Add("@p1", this.textBoxInternetUrl.Text);
            cmd.Parameters.Add("@p2", this.textBoxInternetLogin.Text);
            cmd.Parameters.Add("@p3", this.textBoxInternetPwd.Text);
            cmd.Parameters.Add("@p4", this.textBoxPublisher.Text);
            cmd.Parameters.Add("@p5", this.textBoxUserID.Text);
            cmd.Parameters.Add("@p6", this.textBoxPassword.Text);
            cmd.Parameters.Add("@p7", this.radioButtonSQLAuth.Checked ? 1 : 0);
            cmd.Parameters.Add("@p8", this.textBoxSubscriber.Text);

            cmd.ExecuteNonQuery();
        }

        // This function synchronizes the device database with the server database.
        //
        private void ReplSync() {
            SqlCeReplication replNorthwind = new SqlCeReplication();
			
            // Set the Internet properties.
            //
            replNorthwind.InternetUrl = textBoxInternetUrl.Text;
            replNorthwind.InternetLogin = textBoxInternetLogin.Text;
            replNorthwind.InternetPassword = textBoxInternetPwd.Text;

            // Set the Publisher properties.
            //
            replNorthwind.Publisher = textBoxPublisher.Text;
            replNorthwind.PublisherDatabase = publisherDatabase;
            replNorthwind.Publication = publication;
            replNorthwind.PublisherSecurityMode = radioButtonSQLAuth.Checked ? SecurityType.DBAuthentication : SecurityType.NTAuthentication;
            replNorthwind.PublisherLogin = textBoxUserID.Text;
            replNorthwind.PublisherPassword = textBoxPassword.Text;
			
            // Set the Subscriber properties.
            //
            replNorthwind.SubscriberConnectionString = dataNorthwind.LocalConnString;
            replNorthwind.Subscriber = textBoxSubscriber.Text;

            bool changed = false;

            // Starts the cursor icon since this function may take some time.
            //
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

            try 
            {
                if (ConnectionState.Open == dataNorthwind.NorthwindConnection.State) {
                    dataNorthwind.NorthwindConnection.Close();
                }

                if (init) {
                    
                    // Delete the database if the database exists.
                    // 
                    if (File.Exists(dataNorthwind.LocalDatabaseFile)) {
                        File.Delete(dataNorthwind.LocalDatabaseFile);
                    }

                    // Clear the dataset if it exists.
                    //
                    if (null != dataNorthwind.NorthwindDataSet) {
                        dataNorthwind.NorthwindDataSet.Clear();
                    }

                    // Create the Local SSCE Database subscription.
                    //
                    replNorthwind.AddSubscription(AddOption.CreateDatabase);
                }

                // Synchronize to the server database to populate the Subscription.
                //
                replNorthwind.Synchronize();

                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
                
                // Display the synchronization results.
                //
                MessageBox.Show("Synchronization Complete:\n" +
                    "Publisher changes = " + replNorthwind.PublisherChanges.ToString() + "\n" +
                    "Publisher conflicts = " + replNorthwind.PublisherConflicts.ToString() + "\n" +
                    "Subscriber changes = " + replNorthwind.SubscriberChanges.ToString(),
                    "Synchronize",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Asterisk,
                    MessageBoxDefaultButton.Button1);

                changed = replNorthwind.PublisherChanges > 0 || replNorthwind.PublisherConflicts > 0;
            }
            catch(SqlCeException e) {
                // Error handling mechanism
                //
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
                NorthwindData.ShowErrors(e);
                if (init) 
                {
                    this.formNorthwind.UpdateMenu();
                    return;
                }
            }
            catch(Exception e) {
                // Error handling mechanism
                //
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
                MessageBox.Show(e.Message, "Northwind");

                if (init) {
                    this.formNorthwind.UpdateMenu();
                    return;
                }
            }
            finally {
                // Dispose of the Replication Object
                //
                replNorthwind.Dispose();
            }

            try {
                // Open the connection to the Northwind database.
                //
                dataNorthwind.NorthwindConnection.Open();

                if (init) {
                    // Save the connection information
                    //
                    SaveAppProps();

                    // Set the initialization flag to false and disable the connection information controls.
                    //
                    init = false;
                    this.buttonSync.Text = "Synchronize";
                    this.panelProps.Enabled = false;
                }

                if (changed) {
                    formNorthwind.Refresh();
                }
            }
            catch(SqlCeException e) {
                NorthwindData.ShowErrors(e);
            }
            catch(Exception e) {
                MessageBox.Show(@"Save connection information: " + e.Message, "Northwind");
            }
        }

        private void radioButtonSQLAuth_CheckedChanged(object sender, System.EventArgs e) {
            if (this.radioButtonSQLAuth.Checked) {
                this.textBoxUserID.Enabled = true;
                this.textBoxPassword.Enabled = true;
            }
            else {
                this.textBoxUserID.Enabled = false;
                this.textBoxPassword.Enabled = false;
            }
        }

        private void buttonReset_Click(object sender, System.EventArgs e) {
            if (DialogResult.OK == MessageBox.Show("You are about to reset all data. Continuing will discard all changes.", 
                "Northwind", 
                MessageBoxButtons.OKCancel, 
                MessageBoxIcon.Asterisk, 
                MessageBoxDefaultButton.Button1)) {
                if (ConnectionState.Open == dataNorthwind.NorthwindConnection.State) {
                    dataNorthwind.NorthwindConnection.Close();
                }

                try {
                    if (File.Exists(dataNorthwind.LocalDatabaseFile)) {
                        File.Delete(dataNorthwind.LocalDatabaseFile);
                    }

                    // Clear the dataset if it exists.
                    //
                    if (null != dataNorthwind.NorthwindDataSet) {
                        dataNorthwind.NorthwindDataSet.Clear();
                    }
                }
                catch(Exception err) {
                    MessageBox.Show(err.Message, "Northwind");
                    return;
                }

                init = true;
                this.panelProps.Enabled = true;
                buttonSync.Text = "Initialize";
				formNorthwind.UpdateMenu();
            }
        }

        private void buttonSync_Click(object sender, System.EventArgs e) {
            if (DialogResult.OK == MessageBox.Show("You are about to synchronize your data. Continue?", 
                "Northwind", 
                MessageBoxButtons.OKCancel, 
                MessageBoxIcon.Asterisk, 
                MessageBoxDefaultButton.Button1)) {
                ReplSync();
                formNorthwind.UpdateMenu();
            }
        }	
    }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区中文字幕| 日本伦理一区二区| 久久精品国产亚洲高清剧情介绍 | 日韩码欧中文字| 中文字幕亚洲综合久久菠萝蜜| 国产欧美视频一区二区| 久久久91精品国产一区二区三区| 国产嫩草影院久久久久| 中文字幕在线观看一区二区| 亚洲午夜久久久久久久久电影网 | 激情都市一区二区| 国产成人8x视频一区二区 | 中文字幕欧美日韩一区| 国产精品国产三级国产aⅴ原创 | 日韩欧美一区二区视频| 久久老女人爱爱| 成熟亚洲日本毛茸茸凸凹| 亚洲午夜一区二区三区| 免费在线观看视频一区| 国产成人亚洲综合色影视| 91一区二区在线| 日韩一二三区不卡| 中文字幕的久久| 久久国产日韩欧美精品| 91传媒视频在线播放| 久久精品欧美日韩| 日韩电影一区二区三区| 色哟哟一区二区三区| 天堂资源在线中文精品| 日本韩国精品一区二区在线观看| 欧美丰满美乳xxx高潮www| 亚洲欧美日韩在线不卡| 国产成人av影院| wwwwxxxxx欧美| 午夜精品福利一区二区三区蜜桃| 成人av在线网| 日本一区二区视频在线| 国产很黄免费观看久久| 日韩欧美在线一区二区三区| 日本午夜精品视频在线观看| 欧美三日本三级三级在线播放| 国产欧美精品一区| 一区二区三区日韩在线观看| 国产91精品欧美| 亚洲欧洲国产日本综合| 成人av一区二区三区| 国产精品久久综合| 成人永久aaa| 91麻豆精品国产自产在线观看一区| 久久久综合视频| 精品制服美女久久| 欧美激情一区二区三区蜜桃视频 | 91精品婷婷国产综合久久竹菊| 中文字幕中文字幕一区二区 | 一区二区三区影院| 99精品国产视频| 婷婷开心激情综合| 久久久久久久性| 91麻豆国产香蕉久久精品| 一区二区三区精品在线| 欧美本精品男人aⅴ天堂| 欧美大胆人体bbbb| 日本精品视频一区二区| 一区2区3区在线看| 久久理论电影网| 欧美日韩一区二区不卡| 国产99精品国产| 日产国产欧美视频一区精品| www激情久久| 91精品午夜视频| 欧美亚洲一区二区在线| 99免费精品在线| 日韩一区精品字幕| 亚洲欧美色一区| 国产女主播在线一区二区| 日本网站在线观看一区二区三区| 欧美精品久久99久久在免费线| 国模套图日韩精品一区二区 | 亚洲视频网在线直播| 日韩女优av电影| 欧美精品精品一区| 在线电影院国产精品| 国产精品久久久久毛片软件| 5566中文字幕一区二区电影| 91福利在线导航| 一本久道中文字幕精品亚洲嫩| 成人动漫一区二区| 一道本成人在线| 欧亚一区二区三区| 日本精品视频一区二区| 色88888久久久久久影院按摩| 日本精品一区二区三区四区的功能| 99久久精品久久久久久清纯| 91在线porny国产在线看| 欧洲色大大久久| 日韩欧美色电影| 国产精品天干天干在观线| 亚洲男人天堂av网| 偷窥国产亚洲免费视频 | 欧美另类videos死尸| 欧美浪妇xxxx高跟鞋交| 精品少妇一区二区三区视频免付费| 欧美成人福利视频| 国产精品久久久久三级| 婷婷中文字幕一区三区| 国产乱码字幕精品高清av | 久久久精品国产免费观看同学| 国产精品美女久久久久久久| 亚洲视频免费看| 亚洲最大成人综合| 美日韩黄色大片| 99久久99久久精品免费看蜜桃| 欧美日韩成人一区二区| 国产精品久久久久一区二区三区| 亚洲国产视频一区| 91在线精品一区二区三区| 日韩视频在线一区二区| 一区二区欧美在线观看| 成人午夜视频网站| 欧美精品一区二区三| 午夜一区二区三区视频| 91在线精品一区二区三区| 国产欧美视频一区二区三区| 日韩经典一区二区| 欧美卡1卡2卡| 亚洲国产日产av| 色琪琪一区二区三区亚洲区| 国产精品久久99| 国v精品久久久网| 久久久影院官网| 极品销魂美女一区二区三区| 7777精品久久久大香线蕉| 天天综合天天综合色| 69堂精品视频| 麻豆成人综合网| 精品国产凹凸成av人导航| 激情另类小说区图片区视频区| 精品久久久久久亚洲综合网| 国产一区二区导航在线播放| 精品国产乱码久久久久久1区2区 | 26uuu亚洲综合色| 欧美一区三区四区| 亚洲午夜久久久久久久久电影网| 欧美日韩一区二区三区不卡| 日本不卡视频在线| 久久中文娱乐网| 91看片淫黄大片一级在线观看| 亚洲乱码国产乱码精品精可以看| 9i在线看片成人免费| 亚洲精品中文字幕在线观看| 国产福利电影一区二区三区| 日韩一区二区免费高清| 国产精品888| 首页欧美精品中文字幕| 国产欧美日韩亚州综合| 欧美日韩综合色| 北条麻妃国产九九精品视频| 亚洲成av人综合在线观看| 久久精品欧美一区二区三区不卡| 欧美午夜精品一区二区三区| 国产综合色在线视频区| 亚洲精品乱码久久久久久黑人| 精品人在线二区三区| 日本道在线观看一区二区| 成人综合婷婷国产精品久久| 全国精品久久少妇| 性久久久久久久久久久久| 中文字幕综合网| 亚洲色图色小说| 自拍偷在线精品自拍偷无码专区| 欧美日韩国产美| 欧美麻豆精品久久久久久| 欧美亚洲国产怡红院影院| gogogo免费视频观看亚洲一| 国内偷窥港台综合视频在线播放| 免费国产亚洲视频| 午夜不卡av免费| 午夜视频一区二区三区| 午夜激情久久久| 久热成人在线视频| 欧美激情综合五月色丁香| 欧美日本一区二区三区四区| 欧美日韩一级视频| 日韩精品一区二| 久久久精品国产免大香伊| 国产精品久久久久毛片软件| 1000部国产精品成人观看| 亚洲人成精品久久久久久| 一区二区在线免费| 日本不卡不码高清免费观看| 国精产品一区一区三区mba视频| 成人高清免费观看| 色综合一区二区| 日韩一区二区影院| 日韩理论片在线| 美腿丝袜亚洲色图| 色婷婷国产精品久久包臀| 欧美成人性福生活免费看| 国产精品国产三级国产aⅴ原创| 日韩高清一级片|