Kavi suja

Kavi suja

  • NA
  • 298
  • 170.8k

'Like' condition - MySQL -- Bind in GridView

Sep 6 2013 7:44 AM
Hi,
   I want to make a stored procedure for the following task : Get records from 3 tables based on particular parameters using like command in MySQL. The parameters here, 'first name','last name','id','city','state','country','street'. Here, my procedure worked correctly if,it contains the data in database. For example, In database I've name "Rajkumar". when i search name like "Raj", it'll retry the data. But if i search the name, which is not present in database it'll show the error 

The IListSource does not contain any data sources.

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.Web.HttpException: The IListSource does not contain any data sources.

Source Error: 

Line 270:            catch (Exception ex) Line 271:            { Line 272:                throw ex; Line 273:            } Line 274:            finally

Source File: C:\SHCS final\AAARSW\SHCS V.1\HMS 1.1\HMS.UI\SRC.aspx.cs    Line: 272 

Stack Trace: 

[HttpException (0x80004005): The IListSource does not contain any data sources.]    HMS.UI.SRC.SearchInDatabase() in C:\SHCS final\AAARSW\SHCS V.1\HMS 1.1\HMS.UI\SRC.aspx.cs:272    HMS.UI.SRC.btnsearch_Click(Object sender, EventArgs e) in C:\SHCS final\AAARSW\SHCS V.1\HMS 1.1\HMS.UI\SRC.aspx.cs:163    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

I also try to bind the datagrid within if(!IsPostBack){}. But there's no change
I'm struggle with this. Can anyone help me to do this?


Answers (1)