//</snippetOCSv2_CS_Basic_PeerWithCe_ConfigureCeSyncProvider> //<snippetOCSv2_CS_Basic_PeerWithCe_CeSyncProviderEvents> public void sampleCeProvider_CreatingSchema(object sender, CreatingSchemaEventArgs e) { Console.WriteLine("Full Initialization Process Started....."); Console.WriteLine( string.Format("CreatingSchame Event fired for Database {0}", e.Connection.Database) ); }
/// <summary> /// User called CreateSchema on the CE provider. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void provider_CreatingSchema(object sender, CreatingSchemaEventArgs e) { this.progressForm.listSyncProgress.Items.Add("Full Initialization Process Started....."); this.progressForm.listSyncProgress.Items.Add( string.Format("CreatingSchame Event fired for Database {0}", e.Connection.Database) ); }
//</snippetOCS_CS_Conflicts_ClientApplyChangeFailed> private void SampleClientSyncProvider_CreatingSchema(object sender, CreatingSchemaEventArgs e) { //Set the RowGuid property because it is not copied //to the client by default. This is also a good time //to specify literal defaults with .Columns[ColName].DefaultValue, //but we will specify defaults like NEWID() by calling //ALTER TABLE after the table is created. e.Schema.Tables["Customer"].Columns["CustomerId"].RowGuid = true; }
private void SampleClientSyncProvider_CreatingSchema(object sender, CreatingSchemaEventArgs e) { Console.Write("Creating schema for " + e.Table.TableName + " | "); //Create a compostite primary key for the CustomerInfo table. //<snippetOCS_CS_View_CustomerInfoPrimaryKey> string[] customerInfoPrimaryKey = new string[2]; customerInfoPrimaryKey[0] = "CustomerId"; customerInfoPrimaryKey[1] = "PhoneType"; e.Schema.Tables["CustomerInfo"].PrimaryKey = customerInfoPrimaryKey; //</snippetOCS_CS_View_CustomerInfoPrimaryKey> }
private void SampleClientSyncProvider_CreatingSchema(object sender, CreatingSchemaEventArgs e) { //Set the RowGuid property because it is not copied //to the client by default. This is also a good time //to specify literal defaults with .Columns[ColName].DefaultValue; //but we will specify defaults like NEWID() by calling //ALTER TABLE after the table is created. Console.Write("Creating schema for " + e.Table.TableName + " | "); PrintDataSet(e.Schema.SchemaDataSet); var idColumn = e.Table.TableName + "id"; e.Schema.Tables[e.Table.TableName].Columns[idColumn].RowGuid = true; }
private void SampleClientSyncProvider_CreatingSchema(object sender, CreatingSchemaEventArgs e) { string tableName = e.Table.TableName; Console.Write("Creating schema for " + tableName + " | "); if (tableName == "OrderHeader") { //Set the RowGuid property because it is not copied //to the client by default. This is also a good time //to specify literal defaults with .Columns[ColName].DefaultValue, //but we will specify defaults like NEWID() by calling //ALTER TABLE after the table is created. e.Schema.Tables["OrderHeader"].Columns["OrderId"].RowGuid = true; } if (tableName == "OrderDetail") { //Add a foreign key between the OrderDetail and OrderHeader tables. e.Schema.Tables["OrderDetail"].ForeignKeys.Add("FK_OrderDetail_OrderHeader", "OrderHeader", "OrderId", "OrderDetail", "OrderId"); } }
private void SampleClientSyncProvider_CreatingSchema(object sender, CreatingSchemaEventArgs e) { Console.Write("Creating schema for " + e.Table.TableName + " | "); }
private void SampleClientSyncProvider_CreatingSchema(object sender, CreatingSchemaEventArgs e) { //Set the RowGuid property because it is not copied //to the client by default. This is also a good time //to specify literal defaults with .Columns[ColName].DefaultValue; //but we will specify defaults like NEWID() by calling //ALTER TABLE after the table is created. Console.Write("Creating schema for " + e.Table.TableName + " | "); e.Schema.Tables["Customer"].Columns["CustomerId"].RowGuid = true; }