首先,我的資料庫中有 3 個表:
| 學生 |
|---|
| 學生卡 |
| 姓名 |
| 地址 |
| 其他資訊 |
| 學費 |
|---|
| 學生卡 |
| 年 |
| 學期 |
| 收費多少 |
| 詳細_學費 |
|---|
| 學生卡 |
| 年 |
| 學期 |
| 支付日期 |
| 支付金額 |
然后,我創建了一個存盤程序,在選擇一些列[TuitionFee ]并且[Detailed_TuitionFee ]與StudentID作為引數。
create procedure
@StudentID
as
begin
select
from [TuitionFee ]
left outer join [Detailed_TuitionFee ] on TuitionFee.StudentID = Detailed_TuitionFee.StudentID
and TuitionFee.Semester = Detailed_TuitionFee.Semester
where TuitionFee.StudentID = @StudentID
and Detailed_TuitionFee.StudentID = @StudentID
在C#中,我寫的代碼是
BindingSource bdsTuitionInfo = new BindingSource();
String studentID;
GridControl gCtrlTuition;
GridView gViewTuition;
String sqlCmd = "exec Stored procedure" studentID;
DataTable dt = Program.ExecSqlDataTable(sqlCmd); // create a Data table from SP
bdsTuitionInfo.DataSource = dt; // import data table into Binding source
gCtrlTuition.DataSource = bdsTuitionInfo; // import Binding source into Grid Control
gViewTuition.DataSource = bdsTuitionInfo; // The code shows ERROR: "Property or indexer 'property' cannot be assigned to -- it is read only" here
我如何BindingSource在GridView? 有什么需要調整或配置的GridView嗎?
uj5u.com熱心網友回復:
我從未使用過 DevExpress 的網格,但他們的
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/372219.html
