Asp.net how to solve the error -


I have to design my web page in which I have typed in book id and typed nomenclature I and after that Click the button book stack is available, goes to the second page and is not available then the error message is displayed. The book is not available. My project (library management system)

  Using the system ; Using System.Collections; Using System.configuration; Using System.Data; Using System.Linq; Using System.Web; Using System.Web.Security; Using System.Web.UI; Using System.Web.UI.HtmlControls; Using System.Web.UI.WebControls; Using System.Web.UI.WebControls.WebParts; Using System.Xml.Linq; Using System.Data.SqlClient; Public partial class bookshake: system. Web. UI Page (Secure Object Page_load (Object Sender, EventArgse E) {} Protected Zero Button 1_Click (Object Sender, EventArgse E) {string constr = null; Constr = Configuration Manager. Connection strings ["librarymanagementconnetionstring"] Connection String; SqlConnection cnn = new SqlConnection (Constr); CnnkOpen (); dataSet ds = new dataSet (); Detataibl dt = new Datatebl (); SqlDataAdapter da = new SqlDataAdapter (select "Bukojististrantels from where bookId = '" + txtid. Text.Trim () + "'and Namofock = '"," + "," Error message: object reference is not set in an example of an object.   

I would say that this line is

  if (DSTB [0] ] .Rao.Count & gt; 0)   

is giving the error.

If your DataSet is not a table, then ds.Tables may be empty.

If this is a possibility, then you need a code for it.

If there are no rows ds.Tables [0] Krao should be empty and your exam.

Comments