Server Error in '/' Application.
--------------------------------------------------------------------------------
Both DataSource and DataSourceID are defined on 'gvEMp'. Remove one definition.
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.InvalidOperationException: Both DataSource and DataSourceID are defined on 'gvEMp'. Remove one definition.
Source Error:
Line 21: objemp.Emp_id = txtEMP_ID.Text;
Line 22: gvEMp.DataSource = objemp.View_Employee_by_ID();
Line 23: gvEMp.DataBind();
Line 24: }
Line 25: }
Source File: C:\Users\Let-Joe\Desktop\Perfect10\Perfect10\Update Employee.aspx.cs Line: 23
Stack Trace:
[InvalidOperationException: Both DataSource and DataSourceID are defined on 'gvEMp'. Remove one definition.]
System.Web.UI.WebControls.DataBoundControl.ConnectToDataSourceView() +1802518
System.Web.UI.WebControls.DataBoundControl.GetData() +4
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +59
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
System.Web.UI.WebControls.GridView.DataBind() +4
Perfect10.WebForm27.btnSearh_Click(Object sender, EventArgs e) in C:\Users\Let-Joe\Desktop\Perfect10\Perfect10\Update Employee.aspx.cs:23
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