.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Change Data Capture Question

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :Sql Server
 

I'm learning CDC by using it to create a very simple replication process. Let's say I have CDC set up for tables 'A' and 'B', which happen to have a FK relationship where 'A' is the parent and 'B' is the child. I want to replicate changes to these two tables to another DB.

I'm wondering how best to handle the following scenario. Let's say a user enters a new row in 'A' and then a child row in 'B'. When I go to move this data to my target DB, I need to make sure I move the data in the correct order or I'll get a FK constraint error in the target DB.

The only way I know to do this is as follows:
1) Query the cdc.lsn_time_mapping table and get all the new LSN values in ascending order. 
2) Look for each LSN value in each cdc table by executing the fn_cdc_get_all_changes_??? UDF associated with each cdc table
3) When an LSN value is found in a table, move the data in that to the target DB
4) Repeat #2 until done

With only two tables, as in this example, this is a trivial process. But if I have hundreds of tables with CDC enabled, step #2 could really be slow since I could be quering every CDC enabled table looking for the curre


View Complete Post


More Related Resource Links

Change data capture question ...

  

Hi

can i use a sinlge cdc table for multiple tables ?

i want to query to all changed data within a single query. how to accomplish this ?

thanks in advance


http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

Form Filler: Build Workflows to Capture Data and Create Documents

  

Learn how to create a workflow that uses InfoPath forms and other office documents for passing data to targeted activities and for use in Office documents.

Rick Spiewak

MSDN Magazine June 2008


Change data on gridview bind

  

Hi there,


Simple little problem. i have a gridview that shows products assigned to a customers job. They are displayed in exVAT prices. To make it easier i want to show the inc VAT prices. How can i add VAT to 1 column in this table?


How can I change the color of my clandar by data from Db

  
Sub DayRender(ByVal source As Object, ByVal e As DayRenderEventArgs)
        

            Dim i As Integer
            For i = 0 To DataGrid1.Items.Count - 1
            'If (DataGrid1.Items(i).Cells(1).Text = e.Day.Date) Then
            'If (DataGrid1.Items(i).Cells(0).Text <> "") Then
            If (DataGrid1.Items(i).Cells(1).Text.Equals(e.Day.Date.ToString)) Then

                '  e.Cell.BackColor = Color.DarkOrange
                e.Cell.BackColor = System.Drawing.Color.Red
                e.Cell.ForeColor = System.Drawing.Color.Yellow

            End If
        Next
now I click the day on clendar, which have data from db it chage color ,  How can I let when the calendar is load wich day have dat in db change color ?



    End Sub


 


change calendar date backColor base on data from db

  

I want to  change calendar date backColor base on data from db,  I only have vistual 2003 !

on mean time I have

<asp:DataGrid id="DataGrid1" style="Z-INDEX: 102; LEFT: 23px; POSITION: absolute; TOP: 271px"
		    runat="server" Font-Size="XX-Small" Font-Names="Verdana" AutoGenerateColumns="False" Visible="False">
		    <Columns>
           <asp:BoundColumn DataField="subject" HeaderText="Title"></asp:BoundColumn>
           <asp:BoundColumn DataField="posttimestart" HeaderText="Post date"></asp:BoundColumn>
           </Columns>
		    </asp:DataGrid>


 

Sub DayRender(ByVal source As Object, ByVal e As DayRenderEventArgs)
        Dim i As Integer
        For i = 0 To DataGrid1.Items.Count - 1
            If (DataGrid1.Items(i).Cells(1).Text = e.Day.Date) Then
                e.Cell.BackColor = Color.DarkOrange

            End If
        Next


       
    End Sub

when I click the day wich have data in db it change  color , but I want the page load it change color !

Thank you!


evaluate data in row and change text on asp:ButtonField accordingly.

  

I am building a website for my hockey league.

 

I have a gridview that displays the current weeks scheduled games. Ideally I have added a column to the end of the gridview that I would like display 1 of 3 values. If the game has already been played I would like to display the score of the game; if the game has yet to be played I would like the column blank and if someone on either team has indicated that they can't make the game I would like to display a button that says "subs needed" and take you to another page to sign up to be a sub. Can this be done? I have been able to change the background color of the line based on the two boolean flags from the database using the RowDataBound event handler but I can't seem to find a way to set the value of a specific field in my row. (The background is set for the whole row.)

Thanks in advance -eric


A simple Data Modeling Question

  

I have a data modeling question that hopefully this fictious example will help explain.  My application is data driven and the classes reflect the tables to a large degree.   In this example my database has two tables:

  • VendorMaster with an int Primary Key of VendorID
  • VendorContact with an int Primary Key of ContactID

The VendorContact table also has a Foreign Key of VendorID in order to associate the contact with a specific Vendor.  In this example a Vendor can only have one contact.

My question is how to represent these two tables in terms of classes.  In my current design I have two classes:

  • VendorMaster
  • VendorContact

In order to represent the relationship between a VendorMaster and VendorContact, my VendorMaster class contains a property called VendorContact.

My questions are about the VendorContact class and how it represents the relationship between a VendorMaster and itself.

Option #1

The VendorContact class should contain an int property of VendorID

Option #2

The VendorContact class should contain a VendorMaster Property

I am not sure which option is the 'best' option to take. My concern is that if I go with option #2 that I would create a cyclical relationship between the VendorMaster and Vendo

DataGrid ValidationRule or IDataErrorInfo validation code called multiple times for each data change

  
Following my enquiry regarding a problem in Datagrid validation, for which managing exceptions is apparently a problem, I tested the two other methods: using validation rules, or implementing the IDataErrorInfo interface. I ran into other problems there, more insidious this time. This has been done on Windows7 (32-bit), .NET 4.0.30319. 1) IDataErrorInfo When this interface is implemented, the this[string columnName] property is called four times for each modification: two times before the cell enters edit mode (with the old value in the corresponding property) two times when the new value has to be validated (with the new value) It strikes me as not really efficient, is there something wrong with my code? Here's the C# part: using System; using System.Windows; using System.Collections.ObjectModel; using System.ComponentModel; namespace DataGridTest2 { public partial class MainWindow : Window { ObservableCollection<User> users; public MainWindow() { InitializeComponent(); users = new ObservableCollection<User>() { new User { Name = "Teddy", Age = "2" }, new User { Name = "Avi", Age = "19" } }; datagrid.ItemsSource = users; datagrid.Focus(); } } public class User : INotifyPropertyChanged, IDataErrorInfo { string name; public string Name

Simple data binding question

  
Newbie binding question here: is it possible to bind a control in XAML to a StaticResource by passing in the key via a data structure? Basically something like this: <TextBlock Text="{Binding ImageKey}" /> <Image Source="{StaticResource ResourceKey={Binding ImageKey}}" /> <-- doesn't work   The TextBlock binding on the first line works correctly, it extracts the key of the StaticResource from my data structure and displays it correctly. What I'm trying to do is get the Image control to bind to the StaticResource with that name (which happens to be a BitmapImage).      

Data Mining Solution Question

  
Hi, I am working for a company that would like to use Aanalysis Services for predictive analytics. My problem is that there are only 40 or so months worth of data. I am wondering if this is enough to even make anything relevant and/or accurate.   So far I've made a time series mining structure, that just uses the booking number as input and predict. I am having a hard time justifying this as they view it as something that could have just been done in excel.   Also I have made a neural network. The company has several (continuous) metrics that they track along with bookings. So I made a neural network to use these inputs to predict the bookings.   This made another problem. The prediction that the neural network makes is different from the next month that that time series predicts and is causing distrust by the potential end users.   I've thought about combining the two models. I could use the output of the neural net and do a natural prediction join of that result into the time series.   Seeking advice, and something that I can do with Analysis Services that could be useful to a company with only a small number of months of data to work with.   -S

SQL server 2008 r2 Data sync question???

  
Sql 2008 r2 data sync, does it involve a db hosted by microsoft or does that involve us hosting the sync functionality locally?  I know we have db's local that need to be sync'd across a wan but does that happen in a db hosted in the ms cloud or does that have to do with a sync functionality that runs locally to keep my db's sync'd?   Thanks, SL

Data Mining Solution Question

  
Hi, I am working for a company that would like to use Aanalysis Services for predictive analytics. My problem is that there are only 40 or so months worth of data. I am wondering if this is enough to even make anything relevant and/or accurate.   So far I've made a time series mining structure, that just uses the booking number as input and predict. I am having a hard time justifying this as they view it as something that could have just been done in excel.   Also I have made a neural network. The company has several (continuous) metrics that they track along with bookings. So I made a neural network to use these inputs to predict the bookings.   This made another problem. The prediction that the neural network makes is different from the next month that that time series predicts and is causing distrust by the potential end users.   I've thought about combining the two models. I could use the output of the neural net and do a natural prediction join of that result into the time series.   Seeking advice, and something that I can do with Analysis Services that could be useful to a company with only a small number of months of data to work with.   -S

Question about quality of data

  
Hello, Thanks for the help on the last question.  We have looked at several open source offers in the field of data integration. We are now wanting data quality software to complete our data integration program.  Do packages exist to suit our needs? Would you know of innovative data quality programs? Thanks to all!

change data source of cube

  
how to change data source of cube?

change the date rang in calendar depend on the data from db

  
if the calendar day is match with the date in db I can change the claendar 's background color  with the following code , How if I want  my calendar change color by the range of the data in my db ,  said I want the calendar change color from the starDay to endday of the event , the date rang is random what can I do ??  For Each dr In tmpds.Tables(0).Rows                    If Not dr("startDay") Is DBNull.Value Then                        Dim dtEvent As DateTime = dr("startDay").ToString

Change background colour based on data key change?

  
Hi there,I have a GridView with an alternating Css style. The GridView has a column called tradeId. What I want to show is an alternating colour based on a change in the tradeId. Is this possible? It will make it easier on the eye to group trades together by colour. Here's the GridView code as it is right now:<asp:GridView             ID="dtlEntryStats"             runat="server"             DataSourceID="sdsEntryStats"             DataKeyNames="tradeId"             AlternatingRowStyle-CssClass="alternating"            GridLines="None"             CssClass="gridView"            AutoGenerateRows="false"             AutoGenerateColumns="false"             AllowPaging="true"           &n

Another basic Data Binding question

  
3 days ago (thanks to Olaf) I was able to make progress with binding a data collection to a DataGrid. Since then I have searched the web in vain for a VB example to enable me to switch off the DataGrid AutoGenerateColumns and enter my own columns and appropriate Paths to the Collection’s properties.   The following code works fine but I can’t work out how to enter my own individual columns etc. Can anyone give me the syntax for an example of one column please?   Why is it so difficult to find VB examples of WPF demos etc? (Nearly everything is in C#.)   I have some experience in Access VB so have picked VB in trying to use WPF. I would be grateful for any links to VB WPF resources. Option Explicit On Option Strict On Imports System.Collections.ObjectModel Partial Public Class DataGrid_FilledFromCodeBehind Private _ocEng As ObservableCollection(Of EnPlayer) Public Property EngSqd() As ObservableCollection(Of EnPlayer) Get Return _ocEng End Get Set(ByVal value As ObservableCollection(Of EnPlayer)) _ocEng = value End Set End Property Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded _ocEng = New ObservableCollection(Of EnPlayer)() For i = 0 To 4 EngSqd.Add(New EnPlayer(ref(i), names(i), ages(i), bat(i))) Next Me.DataCon
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend