コード例 #1
0
        // method to dynamically generate create table statement
        private void SetCreateStatement()
        {
            AppPartDataAdapter adapter = new AppPartDataAdapter(this._applicationID, this._Uri);
            AppPart appPart = adapter.GetAppPart(this._appPartID);

            foreach (DataTableSchema schema in this._webSchema)
            {
                this._tableCreate = this._tableCreate + "'" + schema.ColumnName + "' ";

                if (schema.DataTaype.Equals("int"))
                {
                    this._tableCreate = this._tableCreate + "int ";
                }
                else if (schema.DataTaype.Equals("decimal"))
                {
                    this._tableCreate = this._tableCreate + "numeric ";
                }
                else
                {
                    this._tableCreate = this._tableCreate + "nvarchar(255) ";
                }

                if (schema.IsPrimaryKey)
                {
                    this._tableCreate = this._tableCreate + "primary key";
                }
                this._tableCreate = this._tableCreate + ", ";
            }

            // add column for storing web-save status
            this._tableCreate = this._tableCreate + "sentToWeb int default 0);";
        }
コード例 #2
0
        // default cosntructor
        public AppPartUtils(int applicationID, string baseUri)
        {
            this._applicationID = applicationID;
            this._baseUri = baseUri;

            // instantiate data sources
            this._appPartDataAdapter = new AppPartDataAdapter(this._applicationID, this._baseUri);

            // instantiate web service helper
            this._appPartWebServiceHelper = new AppPartWebServiceHelper(this._applicationID, this._baseUri);
        }
コード例 #3
0
 // method to check if a table exists in SQLCE
 private bool TableExists(int appPartID)
 {
     AppPartDataAdapter adapter = new AppPartDataAdapter(this._applicationID, this._Uri);
     AppPart appPart = adapter.GetAppPart(appPartID);
     return adapter.DataTableExists(appPart.AppPartName);
 }
コード例 #4
0
 // method to dynamically generate a drop table statement
 private void SetDeleteStatement()
 {
     AppPartDataAdapter adapter = new AppPartDataAdapter(this._applicationID, this._Uri);
     AppPart appPart = adapter.GetAppPart(this._applicationID);
     this._tableDelete = "DROP TABLE IF EXISTS " + appPart.AppPartName;
 }