In this blog i am trying to develop a simple application built upon Business Data Catalog (BDC) feature of MOSS 2007.Most of the coding-savvy developers will always prefer to go for custom web part development to fetch/store data in database over looking the out-of box features provided by MOSS like the BDC one.The idea behind MOSS BDC is whatever data we can acces using web service or ADO.Net we can bring the same into MOSS sites using this Business Data Catalog.
I am concentrating fully on first time BDC application developers focussing on steps to create simple application so kept the functinality to the lowest minimal possible like fetching SQL table to onto a BDC web part in my site and applying filter over it.
Let us assume that we have simple SQL table named EmployeeTable containg employee information.
Pic : EmployeeTable Schema
Pic : EmployeeTable Sample Data
Now this the data which will be brought into the site .Create XML File like below and this is the crucial one as i am putting all my connections,logics,implementation here. I have tried to put as many comments as posible in between to understand all nodes and its relavance . Also i had split the XML codes into many snapshots for better visibility purpose.Please copy all these XML snapshot contents into athe XML file creted by you to get the complete XML file for our application.
Pic: Snapshot 1 of XML File

Pic : Snapshot 2 Of XML File

Pic : Snapshot 3 Of XML File

Pic : Snapshot 4 Of XML File

Pic : Snapshot 5 of XML File

Pic : Snapshot 6 of XML File

Pic : Snapshot 7 of XML File

Pic 8 : Snapshot of XML File

Pic 9 : Snapshot of XML File
Ooff thats the end of XML code snippets .Please excuse for the bad formatting.Now save the completed xml file to any location.
Now the work starts with Share point server. Go to the cental Administration and then Shares Service Provider Home. Click Import Application Defination available under Business Data Catalog.

Browse to the XML file which you created in the top ,keep the default option as it is and click Import .

As our XML file is correct it will get imported successfully,if it contains errors we will be stopped and getting errors in the next screen which needs to be corrected to go furtther.

Click OK, we will get the summary view of our BDC application which got imported and ready to use in our moss site.

Open your favourite moss site.Click Site Actions ->Edit Page. Clieck Add a Web Part in the zone you want to put the web part.Select the Business Data List Web part

Click OK. Now our Business Data List web part gets added to the site.Being in the Edit Mode click "Open the tool Pane" hyperlink available inside the added web part.
Click the "Browse" option which will open up one more" Web page Dialog" as shown below

Select the BDC application we created ,click OK everwhere to get the page loaded with the BDC web part.

Web part is ready to use now . Remeber that comparison is the filter we difined in our XML file level and EmpID is the parameter to filter/compare. Now filter with EmpID to fecth the data from our line of business system which is SQL table in our case.Click Retreive data link to get different data based on parametres passed (with EmpID = 1)

Observe the retrieved data in the "EmployeeIdentifierList" and cross check with the database.
One more view with another parameter (with EmpID = 2)

In the above article i have used only "EmpId" as parameter and "is equal to" as filter.We can add more parameters and more filter criteria's just by fine-tuning the XML file whcih we have developed for the BDC demo.







