현재 사용자가 탭 페이지 컨트롤에 표시 할 URL을 말할 수있는 동적 URL 탭 시스템을 구축 중입니다.동적 체크 박스 목록
데이터베이스에는 다음과 같은 열이 있습니다.
사용자 ID, int로 URLName의 var에 사용 비트
내가 다시 확인 데이터를 당겨하지만 내가 뭘하려하는 것은 그들이 말하는 수 있도록 사용자 옵션 페이지의 URLName의 그 상태 체크 박스 목록을 채우이다하고 그들이 원하는 탭.
URL을 가져오고 확인란을 만드는 방법은 다음과 같습니다. 그러나 다음과 같은 오류가 계속 발생합니다.
전 = { " '1'의 InvalidArgument = 값 '인덱스'에 대한 유효하지 않습니다 \ 연구 \ nParameter 이름 :. 인덱스"}
그것은 확인을 첫 번째 행을 읽어하지만 2 행 안타 때 그 오류가 반환됩니다.
누구에게 아이디어가 있습니까?
감사
private void GetUserURLS()
{
db.initiateCommand("[Settings].[LoadAllUserURLS]", CommandType.StoredProcedure);
sqlp = db.addParameter("@UserID", _UserID, SqlDbType.Int, ParameterDirection.Input);
sqlp = db.addParameter("@spErrorID", DBNull.Value, SqlDbType.Int, ParameterDirection.InputOutput);
db.executeCommand();
CreateCheckBoxes(db.getTable(0).Rows);
db.releaseCommand();
}
private void CreateCheckBoxes(DataRowCollection rows)
{
try
{
int i = 0;
foreach (DataRow row in rows)
{
//Gets the url name and path when the status is enabled. The status of Enabled/Disabled is setup in the users option page
string URLName = row["URLName"].ToString();
bool enabled = Convert.ToBoolean(row["Enabled"]);
CheckedListBox CB = new CheckedListBox();
CB.Items.Insert(i, URLName);
CB.Tag = "CB" + i.ToString();
checkedListBox1.Items.Add(CB);
i++;
}
}
catch (Exception ex)
{
//Log error
Functionality func = new Functionality();
func.LogError(ex);
//Error message the user will see
string FriendlyError = "There has been populating checkboxes with the urls - A notification has been sent to development";
Classes.ShowMessageBox.MsgBox(FriendlyError, "There has been an Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
어떤 프로그래밍 언어, 환경 등? –
그 좋은 # winform – Steve