当前位置: 首页>>代码示例>>C#>>正文


C# DataRow类代码示例

本文整理汇总了C#中DataRow的典型用法代码示例。如果您正苦于以下问题:C# DataRow类的具体用法?C# DataRow怎么用?C# DataRow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DataRow类属于命名空间,在下文中一共展示了DataRow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DetermineStudentRecipientCount

    protected Int32 DetermineStudentRecipientCount(DataRow CriteriaRow)
    {
        System.Text.StringBuilder sbSQL = new System.Text.StringBuilder();
        sbSQL.Append("select count(portfolioid) from PortfolioUserInfo where active=1 and ConSysID=" + _ConSysID);

        //Gender
        string strGenderSQL = RemoveTrailingComma(CriteriaRow["Cri_Gender"].ToString());
        string strGradeSQL = RemoveTrailingComma(CriteriaRow["Cri_Grades"].ToString());
        string strCountySQL = RemoveTrailingComma(CriteriaRow["Cri_Counties"].ToString());
        string strSchoolSQL = RemoveTrailingComma(CriteriaRow["Cri_Schools"].ToString());
        string strCareerSQL = RemoveTrailingComma(CriteriaRow["Cri_Careers"].ToString());
        string strClusterSQL = RemoveTrailingComma(CriteriaRow["Cri_Clusters"].ToString());
        string strCompanySQL = "";
        if (_MessageTypeID == 3)
            strCompanySQL = (CriteriaRow["Cri_Company"].ToString() == "True") ? CriteriaRow["CompanyID"].ToString() : "";

        if ((strGenderSQL != "All") && (strGenderSQL.Trim() != "1,0"))
          sbSQL.Append(" and GenderID in (" + strGenderSQL + ")");
        if (strGradeSQL != "All")
            sbSQL.Append(" and GradeNumber in (" + strGradeSQL + ")");
        if (strSchoolSQL != "All")
            sbSQL.Append(" and SchoolID in (" + strSchoolSQL + ")");
        if (strCountySQL != "All")
            sbSQL.Append(" and CountyID in (" + strCountySQL + ")");
        if (strCareerSQL != "All")
            sbSQL.Append(" and PortfolioID in (Select PortfolioID from Port_SavedCareers where OccNumber in (" + strCareerSQL + "))");
        if (strClusterSQL != "All")
            sbSQL.Append(" and PortfolioID in (Select PortfolioID from Port_ClusterInterests where ClusterID in (" + strClusterSQL + "))");
        if (strCompanySQL.Length > 0)
            sbSQL.Append(" and PortfolioID in (Select PortfolioID from Port_SavedCompanies where CompanyID = " + strCompanySQL + ")");

        string strTempCount = CareerCruisingWeb.CCLib.Common.DataAccess.GetValue(sbSQL.ToString()).ToString();

        return Convert.ToInt32(strTempCount);
    }
开发者ID:nehawadhwa,项目名称:ccweb,代码行数:35,代码来源:TopMessageDetail.ascx.cs

示例2: CopyRow

 private static void CopyRow(dsPedido.PedidoRow dr, DataRow row, string sTabelaFilho)
 {
     dr.DT_PEDIDO = row["DT_PEDIDO"].ToString();
     dr.CD_CLIENTE = row["CD_CLIENTE"].ToString();
     dr.NM_CLIFOR = row["NM_CLIFOR"].ToString();
     //dr.DS_ENDCLI = row["DS_ENDCLI"].ToString();
     dr.NM_BAIRROCLI = row["NM_BAIRROCLI"].ToString();
     dr.NM_CIDCLI = "";// row["NM_CIDCLI"].ToString();
     dr.CD_UFCLI = row["CD_UFCLI"].ToString();
     dr.CD_CEPCLI = row["CD_CEPCLI"].ToString();
     dr.CD_FONECLI = row["CD_FONECLI"].ToString();
     dr.DS_PRAZO = row["DS_PRAZO"].ToString();
     dr.DS_PROD = row["DS_PROD"].ToString();
     dr.VL_UNIPROD = row["VL_UNIPROD"].ToString();
     dr.QT_PROD = row["QT_PROD"].ToString();
     dr.NM_VENDEDOR = row["NM_VENDEDOR"].ToString();
     dr.CD_PEDCLI = row["CD_PEDCLI"].ToString();
     dr.CD_FONEVEND = row["CD_FONEVEND"].ToString();
     dr.DS_TIPODOC = row["DS_TIPODOC"].ToString();
     dr.ST_PEDIDO = row["ST_PEDIDO"].ToString();
     if (dr.ST_PEDIDO == "F")
     {
         dr.ST_PEDIDO = "Faturado-NFe: " + row["CD_NFSEQ"].ToString(); // utilizado esse campo pois não foi possivel atualizar o dataset do relatório
     }
     else
     {
         dr.ST_PEDIDO = "Pendente";
     }
     dr.VL_DESC = row["VL_DESCONTO_VALOR"].ToString();
     if (sTabelaFilho.Equals("MOVIPEND"))
         dr.NM_CIDCLI = row["DS_COR"].ToString();
     dr.CD_PROD = row["CD_PROD"].ToString();
 }
开发者ID:dramosti,项目名称:Web,代码行数:33,代码来源:Informativo.aspx.cs

示例3: ExactMatch

        private static bool ExactMatch(DataRow row, Type connectionType)
        {
            DebugCheck.NotNull(row);
            DebugCheck.NotNull(connectionType);

            return DbProviderFactories.GetFactory(row).CreateConnection().GetType() == connectionType;
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:7,代码来源:Net40DefaultDbProviderFactoryService.cs

示例4: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (((CareerCruisingWeb.PageBase.IndividualBase)Page).IsArchived || ((CareerCruisingWeb.PageBase.SuperBase)Page).ToolTypeID == "2")
        {
            loginID = CareerCruisingWeb.CCLib.Common.Strings.GetQueryString("LoginID");

            portInfoRow = (DataRow)Session["PortInfo"];

            // get database name
            ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName = CareerCruisingWeb.CCLib.Common.Strings.GetDatabaseName();

            strSubSection = (CareerCruisingWeb.CCLib.Common.Strings.GetQueryString("SubSection") == "") ? "List" : CareerCruisingWeb.CCLib.Common.Strings.GetQueryString("SubSection");
            //form post and execution
            if (Request.ServerVariables["REQUEST_METHOD"] == "POST")
            {
                //delete MatchMaker
                //string strSavedMatchMakerID = CCLib.Common.Strings.GetFormString("SavedMatchMakerID");
                //if (strSavedMatchMakerID != "")
                //{
                //    CCLib.Common.DataAccess.ExecuteNonQuery("delete from Port_SavedMatchMaker where SavedMatchMakerID=" + strSavedMatchMakerID + " and PortfolioID=" + PortInfo["PortfolioID"].ToString());
                //    UpdatePCSStatusFromSection("MatchMaker");
                //}
            }

            //generate values
            dtMatchMaker = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTable("select * from " + ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName + "Port_SavedMatchMaker where PortfolioID=" + portInfoRow["PortfolioID"].ToString());
            if (dtMatchMaker.Rows.Count > 0 && dtMatchMaker.Rows[0]["OccNumbers"].ToString() != "")
            {
                strsOccNumbers = dtMatchMaker.Rows[0]["OccNumbers"].ToString().Split(new char[] { ';' });
            }
        }
    }
开发者ID:nehawadhwa,项目名称:ccweb,代码行数:32,代码来源:MatchMaker.ascx.cs

示例5: Questao

 public Questao(DataRow row)
 {
     this._id = Convert.ToInt32(row["id"]);
     this._basico = new Basico(Convert.ToInt32(row["idbasico"]));
     this._idAvaliacao = Convert.ToInt32(row["idavaliacao"]);
     this._questao = row["questao"].ToString();
 }
开发者ID:neutonmelo,项目名称:Meus-Pedidos,代码行数:7,代码来源:Questao.cs

示例6: ConvertRoleEntity

 private static RoleEntity ConvertRoleEntity(DataRow dr)
 {
     RoleEntity entity = new RoleEntity();
     entity.RoleID = Convert.ToString(dr["UserRoleID"]).Trim();
     entity.RoleName = Convert.ToString(dr["UserRoleName"]).Trim();
     return entity;
 }
开发者ID:conghuiw,项目名称:data-analyze-system,代码行数:7,代码来源:RoleManage.cs

示例7: GetAthleticsAssociationInfo

    protected string GetAthleticsAssociationInfo(DataRow schoolInfo)
    {
        string athleticsAssociationInfo = "";

        switch (schoolInfo["assn_athl_ncaa"].ToString())
        {
            case "1":
                athleticsAssociationInfo = "National College Athletic Association (NCAA) Division 1<br>";
                break;
            case "2":
                athleticsAssociationInfo = "National College Athletic Association (NCAA) Division 2<br>";
                break;
            case "3":
                athleticsAssociationInfo = "National College Athletic Association (NCAA) Division 3<br>";
                break;
            case "X":
                athleticsAssociationInfo = "NCAA<br>";
                break;
        }

        if (schoolInfo["assn_athl_naia"].ToString() == "X")
            athleticsAssociationInfo += "National Association of Intercollegiate Athletics (NAIA)<br>";

        if (schoolInfo["assn_athl_nccaa"].ToString() == "X")
            athleticsAssociationInfo += "National Christian College Athletic Association (NCCAA)<br>";

        if (schoolInfo["assn_athl_nscaa"].ToString() == "X")
            athleticsAssociationInfo += "National Small College Athletic Association (NSCAA)<br>";

        if (schoolInfo["assn_athl_njcaa"].ToString() == "X")
            athleticsAssociationInfo += "National Junior College Athletic Association (NJCAA)<br>";

        return athleticsAssociationInfo;
    }
开发者ID:nehawadhwa,项目名称:ccweb,代码行数:34,代码来源:Athletics.ascx.cs

示例8: Deck

    public Deck(DataRow rawData)
    {
        this.rawData = rawData;

        id = (int)rawData["id"];
        cardsStr = rawData["cards"].ToString();
    }
开发者ID:yum-kvn,项目名称:simarisu,代码行数:7,代码来源:Deck.cs

示例9: User

    public User(DataRow rawData)
    {
        this.rawData = rawData;

        id = (int)rawData["id"];
        stageId = (int)rawData["stage_id"];
    }
开发者ID:yum-kvn,项目名称:kage,代码行数:7,代码来源:User.cs

示例10: PessoaFisica

 public PessoaFisica(DataRow row)
 {
     this._id = Convert.ToInt32(row["id"]);
     this._pessoa = new Pessoa(Convert.ToInt32(row["idpessoa"]));
     this._acesso = new Acesso(Convert.ToInt32(row["idacesso"]));
     this._cpf = row["cpf"].ToString();
 }
开发者ID:neutonmelo,项目名称:Meus-Pedidos,代码行数:7,代码来源:PessoaFisica.cs

示例11: GetArmorParameter

    public Armor.ArmorParameter GetArmorParameter(DataRow row = null)
    {
        Armor.ArmorParameter res = new Armor.ArmorParameter();
        if (row == null) return res;
        res.Name = row.Select("Name").ToString();
        res.CreateTime = float.Parse(row.Select("CreateTime").ToString());
        res.Armor = float.Parse(row.Select("Armor").ToString());

                //parameters
        if (row.Select("PNumber").ToString() != "")
        res.PNumber = int.Parse(row.Select("PNumber").ToString());
        if (row.Select("PPercentage").ToString() != "")
        res.PPercentage = float.Parse(row.Select("PPercentage").ToString());
        if (row.Select("PTime").ToString() != "")
        res.PTime = float.Parse(row.Select("PTime").ToString());
        if (row.Select("PRange").ToString() != "")
        res.PRange = float.Parse(row.Select("PRange").ToString());
        if (row.Select("PDamage").ToString() != "")
        res.PDamage = float.Parse(row.Select("PDamage").ToString());
        if (row.Select("Parameter1").ToString() != "")
        res.Parameter1 = row.Select("Parameter1").ToString();
        if (row.Select("Parameter2").ToString() != "")
        res.Parameter2 = row.Select("Parameter1").ToString();

        //info
        res.Info = row.Select("Info").ToString();
        return res;
    }
开发者ID:AtwoodDeng,项目名称:miniRTS,代码行数:28,代码来源:DataManager.cs

示例12: Item

 public Item(DataRow row)
 {
     foreach(DataColumn c in row.Table.Columns)
     {
       hash[c.ColumnName] = row[c.ColumnName];
     }
 }
开发者ID:norick1701,项目名称:ConvertPGSQLFromMDB,代码行数:7,代码来源:Items.cs

示例13: GetIncidentStatus

    protected string GetIncidentStatus(DataRow row, int indexStatus, int indexUser, int incidentId)
    {
        string display = String.Empty;
        string text = (string)row.ItemArray[indexStatus];
        switch (text)
        {
            case "Assigned":
            {
                //get associated userName from aspnet_Users
                string sqlSelect = "SELECT u.UserName "
                    + "FROM aspnet_Users u, ajjp_Incidents i "
                    + "WHERE u.UserId = i.AssignedUserId "
                    + "AND i.IncidentId = '" + incidentId + "'";

                DataTable userName = DataTypeHandler.GetDataTable(sqlSelect);
                //lblErr.Text += sqlSelect;

                display = "Assigned: " + (string)userName.Rows[0].ItemArray[0];
                break;
            }
            case "Closed":
            {
                display = "Status: Closed";
                break;
            }
            case "Open":
            {
                display = "Status: Open";
                break;
            }
        }
        return display;
    }
开发者ID:JamesWClark,项目名称:DeVry-Senior-Project,代码行数:33,代码来源:ViewItemIncidents.aspx.cs

示例14: Load

 public static StaffPosition Load(DataRow row, string prefix="")
 {
     return new StaffPosition(
         Convert.ToInt32(row[prefix+"staff_position_id"]),
         Convert.ToString(row[prefix+"descr"])
     );
 }
开发者ID:nblaurenciana-md,项目名称:Websites,代码行数:7,代码来源:StaffPositionDB.cs

示例15: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (((CareerCruisingWeb.PageBase.IndividualBase)Page).IsArchived || ((CareerCruisingWeb.PageBase.SuperBase)Page).ToolTypeID == "2")
        {
            loginID = CareerCruisingWeb.CCLib.Common.Strings.GetQueryString("LoginID");

            portInfoRow = (DataRow)Session["PortInfo"];

            // get database name
            ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName = CareerCruisingWeb.CCLib.Common.Strings.GetDatabaseName();

            string commandText = "select AnnualReviewAdvisorID, AnnualReviewDate, AnnualReviewComment, AnnualReviewAdvisorComment, AnnualReviewBL from " + ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName + "PCS_Status_" + ((CareerCruisingWeb.PageBase.IndividualBase)Page).GetPortStateCode() + " where PortfolioID=" + portInfoRow["PortfolioID"];

            pcsStatusTable = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTable(commandText);

            if (pcsStatusTable.Rows.Count > 0)
            {
                pcsStatus = pcsStatusTable.Rows[0];

                if (pcsStatus["AnnualReviewAdvisorID"].ToString() != "")
                    strAdvisorName = CareerCruisingWeb.CCLib.Common.DataAccess.GetValue("select FirstName+' '+LastName as FullName from " + ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName + "PortfolioAdminNames where AdminID=" + pcsStatus["AnnualReviewAdvisorID"].ToString()).ToString();
                else
                    strAdvisorName = "";
            }
        }
    }
开发者ID:nehawadhwa,项目名称:ccweb,代码行数:26,代码来源:AnnualReview.ascx.cs


注:本文中的DataRow类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。