try in the followin way:
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:ConnString %>" selectcommand="SELECT [PhotoId],[Thumbs_Path] FROM [PHOTO_GALLERY]" xmlns:asp="#unknown"></asp:sqldatasource>
and int he web.config file add the connectionstring as:
<add connectionstring="server=.\SQLEXPRESS;database=XXX;Trusted_connection=True;" name="ConnString" providername="System.Data.SqlClient" />