Book detail by ISBN number using ASP.NET

Dear Friends,
I am explaining basic steps by which you can get book detail from ISBN using ASP.NET

I am using 3 providers which have this database catalog and provide such facility.
So below is the list
3)    Google book API
So let us start with first. So to use this service you have to create first access key.

We can get access key by registration at and it is free.
Now when you have access key then you can play with the URL which is responsible for providing the book detail response as shown below

The response of the above URL is XML.
To achieve this I did have created a constant for above URL as shown below

Private Const ISBNAPIURL As String =””

Now on web page I have used a textbox for ISBN number and a button for search

So on click of button search event we did following code

If Me.txtISBN.Text <> String.Empty Then
Dim requestURL As String
Step1: created  request url at run time to fetch ISBN number
requestURL = ISBNAPIURL + Common.GetISBNConfig().ToString() + “&index1=isbn&value1=” + Me.txtISBN.Text.ToString()

‘step2: now as the return type is fixed XML format I have provided the response to XDocument
Dim xDoc As XDocument = XDocument.Load(requestURL)

‘Step 3:- On the avbove XDoc I have applied LINQ to XML and as we know the XML node will have following book elements so we have used it.

Dim resultSet = From book In xDoc.Descendants(“BookData”)
Select New BookDetail() With {.BookTitle = book.Element(“Title”).Value,
.BookAuthor = book.Element(“AuthorsText”).Value,
.BookPublisher = book.Element(“PublisherText”).Value}

Step4 : now we check whether the result set have something or not and  If we found  entry then we assign the output to project.

If resultSet Is Nothing = False AndAlso resultSet.Count() > 0 Then
Me.lblBookName.Text = resultSet.FirstOrDefault().BookTitle.ToString()
Me.lblAuthor.Text = resultSet.FirstOrDefault().BookAuthor.ToString()
Me.lblPublisher.Text = resultSet.FirstOrDefault().BookPublisher.ToString()
Me.lblMessage.Text = “Sorry ISBN Number not found, Please try different number.”
End If
Me.lblMessage.Text = “Please enter the ISBN number”
End If

In this way you can get book detail by ISBN using LINQ to XML feature.

In the next tutorial we  will use wordcat api to access book information using ASP.NET.

Thanks & Best Regards,

Rajat Jaiswal