TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
john kanyora
NA
242
46.1k
Both DataSource and DataSourceID are defined on 'MedicalSche
Nov 1 2017 8:22 AM
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();
}
Reply
Answers (
2
)
Generic List | Console printing
I want to make a simple picture slideshow from the stated fo