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


C# OleDbDataReader.GetInt16方法代码示例

本文整理汇总了C#中System.Data.OleDb.OleDbDataReader.GetInt16方法的典型用法代码示例。如果您正苦于以下问题:C# OleDbDataReader.GetInt16方法的具体用法?C# OleDbDataReader.GetInt16怎么用?C# OleDbDataReader.GetInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.OleDb.OleDbDataReader的用法示例。


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

示例1: CopyCategoryToBO

 public static CategoryInfo CopyCategoryToBO(OleDbDataReader rdr)
 {
     //CAT_ID, CAT_NAME, CAT_STATUS, CAT_MODERATION, CAT_SUBSCRIPTION, CAT_ORDER
     CategoryInfo category = new CategoryInfo
     {
         Id = rdr.GetInt32(0),
         Name = rdr.SafeGetString(1),
         Status = rdr.GetInt16(2),
         ModerationLevel = rdr.SafeGetInt32(3),
         SubscriptionLevel = rdr.SafeGetInt32(4),
         Order = rdr.GetInt32(5)
     };
     return category;
 }
开发者ID:huwred,项目名称:SnitzDotNet,代码行数:14,代码来源:BOHelper.cs

示例2: CopyForumToBO

        public static ForumInfo CopyForumToBO(OleDbDataReader rdr)
        {
            //"F.FORUM_ID,F.CAT_ID,F.F_STATUS,F.F_SUBJECT,F.F_URL,F.F_TOPICS" +
            //",F.F_COUNT,F.F_LAST_POST,F.F_PRIVATEFORUMS,F.F_TYPE,F.F_LAST_POST_AUTHOR,F.F_A_TOPICS,F.F_A_COUNT,F.F_MODERATION" +
            //",F.F_SUBSCRIPTION,F.F_ORDER, F.F_COUNT_M_POSTS,F.F_LAST_POST_TOPIC_ID,F.F_LAST_POST_REPLY_ID,F.F_POLLS,F.F_DESCRIPTION" +
            //",F.F_L_ARCHIVE,F.F_ARCHIVE_SCHED,T.T_SUBJECT,M.M_NAME ";
            ForumInfo forum = new ForumInfo
            {
                Id = rdr.GetInt32(0),
                CatId = rdr.GetInt32(1),
                Status = rdr.GetInt16(2),
                Subject = rdr.SafeGetString(3),
                Url = rdr.SafeGetString(4),
                TopicCount = rdr.GetInt32(5),
                PostCount = rdr.GetInt32(6),
                LastPostDate = rdr.GetSnitzDate(7),
                AuthType = rdr.SafeGetInt32(8),
                Type = rdr.GetInt16(9),
                LastPostAuthorId = rdr.SafeGetInt32(10),
                ArchivedTopicCount = rdr.SafeGetInt32(11),
                ArchivedPostCount = rdr.SafeGetInt32(12),
                ModerationLevel = rdr.SafeGetInt32(13),
                SubscriptionLevel = rdr.SafeGetInt32(14),
                Order = rdr.GetInt32(15),
                UpdatePostCount = rdr.GetInt16(16) == 1,
                LastPostTopicId = rdr.SafeGetInt32(17),
                LastPostReplyId = rdr.SafeGetInt32(18),
                AllowPolls = rdr.GetInt32(19) == 1,
                Description = rdr.SafeGetString(20),
                LastArchived = rdr.GetSnitzDate(21),
                ArchiveFrequency = rdr.SafeGetInt32(22),
                LastPostSubject = rdr.SafeGetString(23),
                LastPostAuthorName = rdr.SafeGetString(24)
            };

            return forum;
        }
开发者ID:huwred,项目名称:SnitzDotNet,代码行数:37,代码来源:BOHelper.cs

示例3: Page_Load

    protected void Page_Load(object sender, EventArgs e) {
        paramSexo = "";
        paramNome = "";
        try {
          paramSexo = Request["RadioButtonList1"];
          paramNome = Request["TextBox1"];
          if (paramSexo == null) paramSexo = "";
          if (paramNome == null) paramNome = "";
        }
        catch(Exception){};

        Label1.Text = "Registros encontrados:";
        String filtro1 = "", filtro2 = "";

        if (paramSexo.Equals("Todos")) {
                filtro1 = " TRUE ";
        }
        else if (paramSexo.Equals("Masculino")) {
                filtro1 = " (sexo='M') ";
        }
        else if (paramSexo.Equals("Feminino"))
        {
            filtro1 = " (sexo='F') ";
        }
        else
        {
            filtro1 = " FALSE ";
            Label1.Text = "";
        }

        filtro2 = " (nomeprof LIKE '%" + paramNome + "%') ";

        try {
          conexao = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/temp/Escola.mdb");
          conexao.Open();

          string sql = "select * from professores WHERE " 
              + filtro1 + " AND " + filtro2 + " ORDER BY nomeprof";
          stm = new OleDbCommand(sql, conexao);
          dr = stm.ExecuteReader();

          String strHTML = "";
          if (dr.HasRows) { //mostramos o cabeçalho da <table> somente se temos registros
              strHTML = "<TABLE name=profs border=1 width='65%'> <TR style='font-size: 14px; font-family: verdana; text-align: center; font-weight: 900; color: #009;'>" 
                  + "<TD>&nbsp;Código&nbsp;</TD><TD>&nbsp;Nome&nbsp;</TD>"
                  + "<TD>&nbsp;Sexo&nbsp;</TD><TD>&nbsp;Salário&nbsp;</TD></TR>";
          }

          while (dr.Read()) {
              int codigo = dr.GetInt16(0); //codprof
              String nome = dr.GetString(1); //nome
              String sexo = dr.GetString(2); //sexo
              float salario = dr.GetFloat(3); //salário
              strHTML += "<TR><TD style='font-size: 12px; font-family: verdana; text-align: center;'>" + codigo
                      + "</TD><TD style='font-size: 12px; font-family: verdana; text-align: left;'>&nbsp;&nbsp;"
                      + nome + "</TD><TD style='font-size: 12px; font-family: verdana; text-align: center;'>"
                      + sexo + "</TD><TD style='font-size: 12px; font-family: verdana; text-align: center;'>" 
                      + salario + "</TD></TR>";
          }

          strHTML += "</TABLE> <br/><br/><br/>";
          LiteralControl lc = new LiteralControl(strHTML);
          Panel2.Controls.Add(lc);
          stm.Dispose();
          dr.Close();
          conexao.Close();
        } catch (Exception exc) {
            Label1.Text = "Erro no processamento do BD - " + exc.Message;
        }
    }
开发者ID:rodrigogregorioneri,项目名称:Projetos-e-exercicios-faculdade,代码行数:70,代码来源:Consulta.aspx.cs

示例4: Element

        public Element(OleDbDataReader reader)
        {
            this._strName = reader.GetString(1);

            if (!reader.IsDBNull(2))
                this._strLocation = reader.GetString(2);
            else
                this._strLocation = "";

            if (!reader.IsDBNull(3))
                this._strSize = reader.GetString(3);
            else
                this._strSize = "";

            if (!reader.IsDBNull(4))
                this._strBgImage = reader.GetString(4);
            else
                this._strBgImage = "";

            if (!reader.IsDBNull(5))
                this._strFontFamily = reader.GetString(5);
            else
                this._strFontFamily = "";

            if (!reader.IsDBNull(6))
                this._strContent = reader.GetString(6);
            else
                this._strContent = "";

            if (!reader.IsDBNull(7))
                this._intFontSize = reader.GetInt16(7);
            else
                this._intFontSize = 0;

            if (!reader.IsDBNull(8))
                this._strFontColor = reader.GetString(8);
            else
                this._strFontColor = "";

            if (!reader.IsDBNull(9))
                this._strCtlName = reader.GetString(9);
            else
                this._strCtlName = "";
        }
开发者ID:vanloc0301,项目名称:ecouponsprinter,代码行数:44,代码来源:DownloadInfo.cs

示例5: GetValue

        private int GetValue(OleDbDataReader oData)
        {
            int intValue;
            string strFieldType;

            strFieldType = Convert.ToString(oData.GetFieldType(0));

            switch (strFieldType)
            {
                case "System.Int16":
                    intValue = Convert.ToInt32(oData.GetInt16(0));
                    break;

                case "System.Int32":
                    intValue = oData.GetInt32(0);
                    break;

                case "System.Double":
                    intValue = Convert.ToInt32(oData.GetDouble(0));
                    break;

                default:
                    intValue = oData.GetInt32(0);
                    break;

            }

            return intValue;
        }
开发者ID:smorrisey,项目名称:afpreportscli,代码行数:29,代码来源:dataupload.cs

示例6: CopyMemberToBO

        public static MemberInfo CopyMemberToBO(OleDbDataReader rdr)
        {
            MemberInfo member = null;
            try
            {
                member = new MemberInfo();

                member.Id = rdr.GetInt32(0);
                member.Status = rdr.GetInt16(1);
                member.Username = rdr.GetString(2);
                member.NTUsername = rdr.SafeGetString(3);
                member.Email = rdr.SafeGetString(4);
                member.Country = rdr.SafeGetString(5);
                member.HomePage = rdr.SafeGetString(6);
                member.Signature = rdr.SafeGetString(7);
                member.MemberLevel = rdr.GetInt16(8);
                member.AIM = rdr.SafeGetString(9);
                member.Yahoo = rdr.SafeGetString(10);
                member.ICQ = rdr.SafeGetString(11);
                member.Skype = rdr.SafeGetString(12);
                member.PostCount = rdr.SafeGetInt32(13) ?? 0;
                member.MemberSince = rdr.GetSnitzDate(14) == null ? DateTime.UtcNow : rdr.GetSnitzDate(14).Value;
                member.LastVisitDate = rdr.GetSnitzDate(15);
                member.LastPostDate = rdr.GetSnitzDate(16);
                member.Title = rdr.SafeGetString(17); //member.MemberTitle(rdr.SafeGetString(17));
                member.AllowSubscriptions = rdr.SafeGetInt16(18) == 1;
                member.HideEmail = rdr.SafeGetInt16(19) == 1;
                member.ReceiveEmails = rdr.SafeGetInt16(20) == 1;
                member.MembersIP = rdr.SafeGetString(21);
                member.ViewSignatures = rdr.SafeGetInt16(22) == 1;
                member.UseSignature = rdr.SafeGetInt16(23) == 1;
                member.Voted = rdr.SafeGetInt32(24) == 1;
                member.AllowEmail = rdr.SafeGetInt16(25) == 1;
                member.Avatar = rdr.SafeGetString(26);
                member.Theme = rdr.SafeGetString(27);
                member.TimeOffset = rdr.SafeGetDouble(28);
                member.DateOfBirth = rdr.SafeGetString(29);
                member.Age = rdr.SafeGetString(30);
                member.Password = rdr.GetString(31);
                member.ValidationKey = rdr.SafeGetString(32);
                member.IsValid = rdr.SafeGetInt32(33) == 1;
                member.LastUpdateDate = rdr.GetSnitzDate(34);
                member.MaritalStatus = rdr.SafeGetString(35);
                member.Firstname = rdr.SafeGetString(36);
                member.Lastname = rdr.SafeGetString(37);
                member.Occupation = rdr.SafeGetString(38);
                member.Gender = rdr.SafeGetString(39);
                member.Hobbies = rdr.SafeGetString(40);
                member.LatestNews = rdr.SafeGetString(41);
                member.FavouriteQuote = rdr.SafeGetString(42);
                member.Biography = rdr.SafeGetString(43);
                member.FavLink1 = rdr.SafeGetString(44);
                member.FavLink2 = rdr.SafeGetString(45);
                member.City = rdr.SafeGetString(46);
                member.State = rdr.SafeGetString(47);
                member.UseDaylightSaving = rdr.SafeGetInt16(48) == 1;
                member.TimeZone = rdr.SafeGetString(49);

            }
            catch (Exception ex)
            {
                throw new Exception("Error copying reader to BO");
                OleDbDataReader rdrtest = rdr;
                string test = ex.Message;
            }

            string title = member.Title;
            //member.Rank = new RankInfo(member.Username, ref title, member.PostCount);
            member.Title = title;
            return member;
        }
开发者ID:huwred,项目名称:SnitzDotNet,代码行数:71,代码来源:BOHelper.cs

示例7: CopyTopicToBO

        public static TopicInfo CopyTopicToBO(OleDbDataReader rdr)
        {
            TopicInfo topic;
            try
            {
                topic = new TopicInfo
                {
                    Id = rdr.GetInt32(0),
                    CatId = rdr.GetInt32(1),
                    ForumId = rdr.GetInt32(2),
                    Status = rdr.GetInt16(3),
                    Subject = rdr.SafeGetString(4),
                    AuthorId = rdr.GetInt32(5),
                    ReplyCount = rdr.GetInt32(6),
                    Views = rdr.GetInt32(7),
                    LastPostDate = rdr.GetSnitzDate(8),
                    Date = rdr.GetSnitzDate(9).Value,
                    PosterIp = rdr.SafeGetString(10),
                    LastPostAuthorId = rdr.SafeGetInt32(11),
                    IsSticky = rdr.GetInt16(12) == 1,
                    LastEditDate = rdr.GetSnitzDate(13),
                    LastEditedById = rdr.SafeGetInt32(14),
                    UseSignatures = rdr.GetInt16(15) == 1,
                    LastReplyId = rdr.SafeGetInt32(16),
                    UnModeratedReplies = rdr.GetInt32(17),
                    Message = rdr.SafeGetString(18)

                };

                if (rdr.FieldCount > 19)
                {
                    topic.AuthorName = rdr.SafeGetString(19);
                    topic.LastPostAuthorName = rdr.SafeGetString(20);

                    topic.EditorName = rdr.SafeGetString(21);
                    if (rdr.FieldCount > 22)
                    {
                        topic.AuthorViewSig = rdr.GetInt16(22) == 1;
                        topic.AuthorSignature = rdr.SafeGetString(23);
                    }
                }
            }
            catch (Exception)
            {
                return null;
            }

            return topic;
        }
开发者ID:huwred,项目名称:SnitzDotNet,代码行数:49,代码来源:BOHelper.cs

示例8: CopySearchResultToBO

 public static SearchResult CopySearchResultToBO(OleDbDataReader rdr, ref int rowcount)
 {
     SearchResult result = new SearchResult
     {
         CategoryStatus = rdr.GetInt16(0),
         CategorySubscriptionLevel = rdr.GetInt32(1),
         CategoryTitle = rdr.SafeGetString(2),
         ForumSubject = rdr.SafeGetString(3),
         ForumSubscriptionLevel = rdr.GetInt32(4),
         ForumStatus = rdr.GetInt16(5),
         ForumAccessType = rdr.GetInt32(6),
         ForumPassword = rdr.SafeGetString(7),
         CatId = rdr.GetInt32(8),
         ForumId = rdr.GetInt32(9),
         Id = rdr.GetInt32(10),
         AuthorId = rdr.GetInt32(11),
         Subject = rdr.SafeGetString(12),
         Status = rdr.GetInt16(13),
         LastPostDate = rdr.GetSnitzDate(14),
         LastPostAuthorId = rdr.SafeGetInt32(15),
         LastReplyId = rdr.SafeGetInt32(16),
         ReplyCount = rdr.GetInt32(17),
         UnModeratedReplies = rdr.GetInt32(18),
         Views = rdr.GetInt32(19),
         AuthorName = rdr.SafeGetString(21),
         LastPostAuthorName = rdr.SafeGetString(22)
     };
     //rowcount = rdr.GetInt32(24);
     return result;
 }
开发者ID:huwred,项目名称:SnitzDotNet,代码行数:30,代码来源:BOHelper.cs

示例9: CopyReplyToBO

        public static ReplyInfo CopyReplyToBO(OleDbDataReader rdr)
        {
            ReplyInfo reply = new ReplyInfo
                                  {
                                      Id = rdr.GetInt32(0),
                                      CatId = rdr.GetInt32(1),
                                      ForumId = rdr.GetInt32(2),
                                      TopicId = rdr.GetInt32(3),
                                      AuthorId = rdr.GetInt32(4),
                                      Date = rdr.GetSnitzDate(5).Value,
                                      PosterIp = rdr.SafeGetString(6),
                                      Status = rdr.GetInt16(7),
                                      LastEditDate = rdr.GetSnitzDate(8),
                                      LastEditedById = rdr.SafeGetInt32(9),
                                      UseSignatures = rdr.GetInt16(10) == 1,
                                      Message = rdr.SafeGetString(11)
                                  };

            if (rdr.FieldCount > 12)
            {
                reply.AuthorName = rdr.SafeGetString(12);
                reply.EditorName = rdr.SafeGetString(13);
                reply.AuthorViewSig = rdr.GetInt16(14) == 1;
                reply.AuthorSignature = rdr.SafeGetString(15).Replace(">", "]").Replace("<", "[");
            }
            return reply;
        }
开发者ID:huwred,项目名称:SnitzDotNet,代码行数:27,代码来源:BOHelper.cs


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