hi, kindly help on this one...am getting the following error " Both DataSource and DataSourceID are defined on 'MedicalSchemeDetailGrid'. Remove one definition"
below is my aspx page with the datasource
- <ContentTemplate>
- <ctls:SearchPanel ID="MedicalSchemeDetailSearchPanel" runat="server" GridID="MedicalSchemeDetailGrid" SearchButtonText="Search" ClearButtonText="Clear" ExpressionLabel="Search Expression" Visible="false" />
- <div class="vsep"> </div> <rwg:BulkEditGridView ID="MedicalSchemeDetailGrid" runat="server" DataMember="MedicalSchemeDetail" OnPageIndexChanging="MedicalSchemeDetailGrid_PageIndexChanging" AllowPaging="true" DataSourceID="DBDataSource1" AutoGenerateColumns="False" DataKeyNames="CompanyID,BranchID,DepartmentID,MedicalSchemeID,ItemID,PatientStatus"> <HeaderStyle Height="30px" />
and below is my code behind
- protected void FilterMedicalSchemeDetails(string treatmentGroup)
- {
- string medicalschemdid = string.Empty;
- string selectedGroup = string.Empty;
- DataView dw = (DBDataSource1.State.BusinessObject.DataSet.Tables["MedicalSchemeHeader"]).DefaultView;
- medicalschemdid = dw[0]["MedicalSchemeID"].ToString();
- SqlDataSource dbSrc = new SqlDataSource();
- dbSrc.ConnectionString = TraceBizCommon.Configuration.ConfigSettings.ConnectionString;
- if (treatmentGroup != string.Empty && treatmentGroup != "ALL")
- dbSrc.SelectCommand = "SELECT * FROM MedicalSchemeDetailByTreatmentGroups WHERE CompanyID = '" + CompanyID + "' AND BranchID = '" + BranchID + "' AND DepartmentID = '" + DepartmentID + "' AND TreatmentGroup = '" + treatmentGroup + "' ORDER BY MedicalSchemeID";
- else
- dbSrc.SelectCommand = "SELECT * FROM MedicalSchemeDetailByTreatmentGroups WHERE CompanyID = '" + CompanyID + "' AND BranchID = '" + BranchID + "' AND DepartmentID = '" + DepartmentID + "' ORDER BY MedicalSchemeID";
- MedicalSchemeDetailGrid.DataSource = dbSrc;
- MedicalSchemeDetailGrid.DataBind();
- }