Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 17:         ///Gallery
Line 18:         StringBuilder sb1 = new StringBuilder();
Line 19:         SqlDataAdapter da1 = new SqlDataAdapter("select convert(nvarchar,b.renDate,106) as 'DATE', a.materialTitle as 'TITLE', b.category as 'TYPE', (case when b.fileType='Link' then b.fileName else 'Gallery/'+b.fileName end) as 'DOWNLOAD', a.autoId as 'AUTOID' from tblGalleryDTSKSMWeb a,tblGalleryuploadphotoDTSKSMWeb b where b.gallerytitleId="+Request.QueryString["autoId"].ToString().Trim()+" and a.autoid=b.gallerytitleid and a.astatus='OK' and b.status='OK' order by b.renDate desc, b.autoid desc", con);
Line 20:         DataSet ds1 = new DataSet();
Line 21:         da1.Fill(ds1, "tblll");

Source File: c:\inetpub\vhosts\debracollege.ac.in\httpdocs\AlbumImages.aspx.cs    Line: 19

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   AlbumImages.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\debracollege.ac.in\httpdocs\AlbumImages.aspx.cs:19
   System.Web.UI.Control.OnLoad(EventArgs e) +105
   System.Web.UI.Control.LoadRecursive() +67
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3784


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.4076.0