I am trying to test your code, so i found this below error:
First all:I only put the Code into a web application folder,not user the vs.net to do,but when i try to browse the page,the application error tell me

on't load the Masterdetail.masterdeatil,error line's Code is:inherits=Masterdetail.masterdetail.
Second:I created a solution in vs.net,above the error is losed,but the .aspx page not display the result,why?
My sql server connection string is right!