Compare records of each tables of Source & Target database

Dear Friends,
In last post we have seen how easy to find the database changes and generate script for the changes that will help you in deployment.

Similarly sometimes you need to know

row by row data difference in two databases

so don’t worry about that because visual studio 2010 provided

data comparison

option also. Just follow below steps and you are good to go for database changes also
Step 1:-

Go to following menu in Visual Studio as shown in below Fig
Data ==> Data Compare ==> New Data Comparison

dataCompareOption
Step 2:- When you click the above provided menu then you will get following screen. Just configure the

source and Destination databases

.
Check record comparison options which you want like different records only, only in source, only in destination, identity records etc. Now press NEXT button.

DataComparision

Step 3:- As you press the next button you will find the screen where you can select all or particular table or view for comparison as shown in below fig.

Datacomparison_Table_Selection

Step 4:- Once you have selected the particular table(s) and view (s) you will get following screen where you can find table wise comparison like, How many identical records in both tables ?, How many records exists only in source table?, How many records exists only in destination table ?

And below the comparison grid you will find different tabs also for different result sets you just need to select the tab to see the records associated with those particular criteria.

DataComparision_ResultSet

Step 5:- Now with show data update script menu option you can generate script.

Database_Comparison_Result_Set

script_After_Data_Comparison

Now just copy & paste and you are good to go.
So I hope you understand the essence of this utility also.

Enjoy .NET
Enjoy learning.
Keep Sharing 🙂

Your host
Rajat Jaiswal

Book information by ISBN number using ASP.NET from Google API

Dear Friends,
In last 2 posts we have talked about ISBNDB.com(https://indiandotnet.wordpress.com/2012/10/24/book-detail-by-isbn-number-using-asp-net/)

& Wordcat.org (https://indiandotnet.wordpress.com/2012/10/24/book-details-by-isbn-using-asp-net-from-worldcat-org/).
Now here I am talking about one more great service provider which Google. We can use Google API to fetch book detail using ISBN number.
To use Google API you have to create account and register for API.

In this example I am not using API, I am just trying to access the detail directly using URL.
Below URL is used for providing the detail of the book using ISBN

https://www.googleapis.com/books/v1/volumes?q=0123344+ISBN

So let us start to fetch detail

As the response of this URL in JSON so for change I have used JSON parser here I have used JSON.NET which you can download from codeplex site.

The design of the page is same one textbox for ISBN and one search button. On search button click I wrote following code.

‘Step 1:- google API url responsible for returning the book detail in JASON format
Private Const GOOGLEAPIURL As String = “https://www.googleapis.com/books/v1/volumes?q=”

If Me.txtISBN.Text <> String.Empty Then
Dim requestURL As String

‘Step 2:- Reformed the URL to target particular ISBN number
requestURL = GOOGLEAPIURL + Me.txtISBN.Text.Trim() + “+isbn”

‘Step 3: created Http webrequest for URL
Dim wr As HttpWebRequest = HttpWebRequest.Create(requestURL)
‘Step4 : get the response of web request in http web response object
Dim resp As HttpWebResponse = wr.GetResponse()

‘Step 5: passes the response stream in stream reader
Dim sreader As New StreamReader(resp.GetResponseStream())
‘Step 6: parsing the reader(which is in Jason format) using JASON.NET

Dim rss = JObject.Parse(sreader.ReadToEnd())

‘Step 7: if object find the fetch the detail

If rss Is Nothing = False AndAlso rss.Count > 0 Then
Me.lblBookName.Text = rss.Item(“items”)(0).Item(“volumeInfo”).Item(“title”).ToString()
Me.lblAuthor.Text = rss.Item(“items”)(0).Item(“volumeInfo”).Item(“authors”).ToString().Replace(“[“, “”).Replace(“]”, “”).ToString()
Me.lblPublisher.Text = rss.Item(“items”)(0).Item(“volumeInfo”).Item(“publisher”).ToString()
Else
Me.lblMessage.Text = “Sorry ISBN Number not found, Please try different number.”
End If
Else
Me.lblMessage.Text = “Please enter the ISBN number”
End If

So in this way we have accessed book information from Google API URL without using API key.
Thanks & best regards,
Rajat Jaiswal

Book details by ISBN using ASP.NET from worldcat.org

Dear Friends,
In last post we have talked about ISBNDB.COM’s API and how to fetch the book detail using ISBN number from ISBNDB.com (https://indiandotnet.wordpress.com/2012/10/24/book-detail-by-isbn-number-using-asp-net/)

Now in this post we will talk about Worldcat.org, which is another famous book detail service provider.
It provides the response in XML

http://xisbn.worldcat.org/webservices/xid/isbn/1090280?method=getMetadata&format=xml&fl=*

 

So let us start with step 1

The page design is just simple an ISBN textbox and a search button.

So to access this I have created a WORLDCAT URL

Private Const WORLDCATURL As String = “http://xisbn.worldcat.org/webservices/xid/isbn/&#8221;

Now for change I have used Dataset here
Now on the search button click I did following code

If Me.txtISBN.Text <> String.Empty Then

‘Step2: Recreating the URL with specific ISBN number which provided by the end user
Dim requestURL As String
requestURL = WORLDCATURL + “/” + Me.txtISBN.Text.Trim() + “?method=getMetadata&format=xml&fl=*”

‘Step3: Created a xML document object and provided the Requested URL To it
Dim Doc As XmlDocument = New XmlDocument()
Doc.Load(requestURL)

‘ step 4: created dataset object and providing the XML reader to dataset
Dim ds As DataSet = New DataSet()
Dim xmlReader As XmlNodeReader = New XmlNodeReader(Doc)
ds.ReadXml(xmlReader)

‘Step 5: It will return 2 tables if the isbn number is correct so below is the logic to get book detail
If ds Is Nothing = False AndAlso ds.Tables(1).Rows.Count() > 0 Then
Me.lblBookName.Text = ds.Tables(1).Rows(0)(“title”).ToString()
Me.lblAuthor.Text = ds.Tables(1).Rows(0)(“author”).ToString()
Me.lblPublisher.Text = ds.Tables(1).Rows(0)(“publisher”).ToString()
Else
Me.lblMessage.Text = “Sorry ISBN Number not found, Please try different number.”
End If
Else
Me.lblMessage.Text = “Please enter the ISBN number”
End If

So in this way we get the book detail from ISBN using WorldCat.org provider.

Thanks & Best Regards,
Rajat Jaiswal