コード例 #1
0
    public void FetchCodeListData()
    {
        GlobalClass gClass = new GlobalClass();

        System.Data.SqlClient.SqlCommand cmdSelect = new System.Data.SqlClient.SqlCommand();

        gClass.MakeStoreProcedureName(ref cmdSelect, "sp_Codes_LoadData", false);
        cmdSelect.Parameters.Add("@UserPracticeCode", System.Data.SqlDbType.Int).Value     = Convert.ToInt32(Request.Cookies["UserPracticeCode"].Value);
        cmdSelect.Parameters.Add("@CategoryCode", System.Data.SqlDbType.VarChar, 10).Value = strCriteria;

        CodeList.DataSource     = gClass.FetchData(cmdSelect, "tblCode");
        CodeList.DataMember     = "tblCode";
        CodeList.DataValueField = "Code";
        CodeList.DataTextField  = "Description";
        try { CodeList.DataBind(); }
        catch { }
        if (blnFirstRow == true)
        {
            CodeList.Items.Insert(0, new ListItem("Select ...", ""));
        }
        //CodeList.Items.Insert(0, new ListItem((strCriteria.Equals(strGroupCode) ? "Select (optional)..." : "Select ..."), ""));
        return;
    }