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


C# OleDbDataReader.GetInt32方法代码示例

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


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

示例1: Form1

        public Form1()
        {
            InitializeComponent();
            PC.list = new List<PC>();
            PC.total = new List<PC>();
            data.Columns.Add("Id", "Id");
            data.Columns.Add("PC", "PC");
            data.Columns.Add("Inicio", "Inicio");
            data.Columns.Add("Tiempo", "Tiempo");
            data.Columns.Add("Total", "Total");
            data.Columns[3].Width = 130;
            data.Columns[3].Width = 130;
            r = MSAConnection.read("select * from item");
            while (r.Read())
            {
                String d = "";
                PC p = new PC();
                p.id = r.GetInt32(0);
                p.precio = r.GetInt32(2);
                if (!r.IsDBNull(3))
                {
                    //d = r.GetDateTime(3).ToString();
                    DateTime x = r.GetDateTime(3);
                    d = x.Hour + ":" + x.Minute + ":" + x.Second;
                    p.inicio = r.GetDateTime(3);
                    PC.list.Add(p);
                }
                PC.total.Add(p);
                data.Rows.Add(r.GetInt32(0), r.GetString(1), d);
            }
            //            MessageBox.Show(PC.total.Count + "");

            thetimer.Start();
        }
开发者ID:evilnapsis,项目名称:cibertim-msa,代码行数:34,代码来源:Form1.cs

示例2: AddNodeItem

        protected override TreeNode AddNodeItem(TreeNode aTn, OleDbDataReader aReader, ref int aSI)
        {
            /// В pSQLString должен быть определен примерно такой select:
              /// ...
              /// SELECT
              ///		refCode, refBName, 1, ...
              /// FROM
              ///		rbRef
              /// ...

              TreeNode ntn = new TreeNode(aReader.GetString(1));
              PCTVItemData tid = new PCTVItemData();
              ntn.Tag = tid;
              tid.pPC.code = aReader.GetInt32(0);
              /// Added M.Tor 25.06.2008:
              tid.pText = aReader.GetString(1);
              if (aReader.GetInt32(2) > 0)
            ntn.Nodes.Add(new TreeNode());

              if (aTn == null)
              {
            Nodes.Add(ntn);
            tid.pPath = tid.pCode.ToString();
              }
              else
              {
            aTn.Nodes.Add(ntn);
            tid.pPath = ((PCTVItemData)aTn.Tag).pPath + pPathDelim + tid.pCode;
              }

              aSI = 3;

              return ntn;
        }
开发者ID:infobook,项目名称:Query3,代码行数:34,代码来源:ucParamTV.cs

示例3: CopyFaqQuestionsToBO

 public static FaqInfo CopyFaqQuestionsToBO(OleDbDataReader rdr)
 {
     FaqInfo faqquestion = new FaqInfo
         {
             Id = rdr.GetInt32(0),
             Link = rdr.SafeGetString(1),
             LinkTitle = rdr.SafeGetString(2),
             LinkBody = rdr.SafeGetString(3),
             CatId = rdr.GetInt32(4),
             Language = rdr.SafeGetString(5),
             Order = rdr.GetInt32(6)
         };
     return faqquestion;
 }
开发者ID:huwred,项目名称:SnitzDotNet,代码行数:14,代码来源:BOHelper.cs

示例4: 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

示例5: Advertisement

 public Advertisement(OleDbDataReader reader)
 {
     this.StrId = reader.GetString(0);
     if (!reader.IsDBNull(1))
         this.IntType = reader.GetInt32(1);
     else
         this.IntType = 3;
     if (!reader.IsDBNull(2))
         this.StrContent = reader.GetString(2);
     else
         this.StrContent = "";
 }
开发者ID:vanloc0301,项目名称:ecouponsprinter,代码行数:12,代码来源:DownloadInfo.cs

示例6: Holiday

        // Constructor for searched volunteer holiday
        public Holiday(uint gvhid)
        {
            // Declarations
            uint gvoid = 0, modifiedby = 0;
            DateTime datemodified = new DateTime(1901, 1, 1), start = new DateTime(1901, 1, 1), end = new DateTime(1901, 1, 1);

            // Command
            string query = string.Format("SELECT gvo_id, gvh_start, gvh_end, date_modified, modified_by " +
                                            "FROM gfrc_volunteer_holiday WHERE gvh_id = {0}", gvhid);

            try
            {
                using (conn)
                {
                    conn.Open();
                    cmd = new OleDbCommand(query, conn);
                    rdr = cmd.ExecuteReader();

                    while (rdr.Read())
                    {
                        gvoid = Convert.ToUInt32(rdr.GetInt32(0));
                        start = rdr.GetDateTime(1);
                        if (!DateTime.TryParse(rdr.GetValue(2).ToString(), out end))
                            end = new DateTime(1901, 1, 1);
                        if (!DateTime.TryParse(rdr.GetValue(14).ToString(), out datemodified))
                            datemodified = new DateTime(1901, 1, 1);
                        if (!UInt32.TryParse(rdr.GetValue(15).ToString(), out modifiedby))
                            modifiedby = 0;
                    }
                }
            }
            finally
            {
                if (rdr != null)
                    rdr.Close();
            }
            if (conn != null)
            {
                conn.Close();
            }

            _gvhID = gvhid;
            _gvoID = gvoid;
            _Start = start;
            _End = end;
            _DateModified = datemodified;
            _ModifiedBy = modifiedby;
        }
开发者ID:CyanideGiraffe,项目名称:GFRC,代码行数:49,代码来源:Holiday.cs

示例7: Load

 public static void Load(this DataObject dataObj, OleDbDataReader reader)
 {
     try
     {
         foreach (ColumnDefinition columnDef in dataObj.ColumnDefs())
         {
             if (reader.GetValue(columnDef.ColumnIndex) != DBNull.Value)
             {
                 switch (columnDef.ColumnFieldType)
                 {
                     case ColumnDefinition.FieldType.String:
                         dataObj.GetColumnValues()[columnDef.ColumnIndex] = reader.GetString(columnDef.ColumnIndex);
                         break;
                     case ColumnDefinition.FieldType.Int32:
                         dataObj.GetColumnValues()[columnDef.ColumnIndex] = reader.GetInt32(columnDef.ColumnIndex);
                         break;
                     case ColumnDefinition.FieldType.Boolean:
                         dataObj.GetColumnValues()[columnDef.ColumnIndex] = reader.GetBoolean(columnDef.ColumnIndex);
                         break;
                 }
             }
             else //default values for nulls
             {
                 switch (columnDef.ColumnFieldType)
                 {
                     case ColumnDefinition.FieldType.String:
                         dataObj.GetColumnValues()[columnDef.ColumnIndex] = string.Empty;
                         break;
                     case ColumnDefinition.FieldType.Int32:
                         dataObj.GetColumnValues()[columnDef.ColumnIndex] = 0;
                         break;
                     case ColumnDefinition.FieldType.Boolean:
                         dataObj.GetColumnValues()[columnDef.ColumnIndex] = false;
                         break;
                 }
             }
         }
     }
     catch (Exception e)
     {
         //TODO: what to do here?
     }
 }
开发者ID:carriercomm,项目名称:InventoryManagement,代码行数:43,代码来源:DataAccessExtensions.cs

示例8: Kontaktdaten

        public Kontaktdaten()
        {
            InitializeComponent();
            try
            {
                dBVerbindung = new OleDbConnection(verbindungsstring);
                dBVerbindung.Open();
                offen = true;
                befehl = dBVerbindung.CreateCommand();
                //Übersicht (DataGHridView) anzeigen
                befehl.CommandText = "select * from Kontakte;";
                datenleser = befehl.ExecuteReader();
                int row = 0;
                while (datenleser.Read())
                {
                    //leere zeile hinzufügen
                    string[] row_init = { "", "", "", "", "" };
                    dataGridViewKontakte.Rows.Add(row_init);
                    //GridView füllen
                    dataGridViewKontakte.Rows[row].Cells[0].Value = datenleser.GetInt32(0).ToString();
                    dataGridViewKontakte.Rows[row].Cells[1].Value = datenleser.GetString(1);
                    dataGridViewKontakte.Rows[row].Cells[2].Value = datenleser.GetString(2);
                    dataGridViewKontakte.Rows[row].Cells[3].Value = datenleser.GetString(3);
                    dataGridViewKontakte.Rows[row].Cells[4].Value = datenleser.GetString(4);
                    dataGridViewKontakte.Rows[row].Cells[5].Value = datenleser.GetString(5);
                    row = row + 1;
                }

            }
            catch (Exception ausnahme)
            {
                MessageBox.Show("Datenbankfehler: " + ausnahme.Message);
            }
            finally
            {
                if (offen == true) dBVerbindung.Close();
            }
        }
开发者ID:Totti1987,项目名称:Terminverwaltung,代码行数:38,代码来源:Kontaktdaten.cs

示例9: 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

示例10: getOrderList

 internal static List<Order> getOrderList()
 {
     List<Order> ol = new List<Order>();
     try
     {
         //IFNULL(SUM(score),'N')
         cmd = new OleDbCommand("SELECT Orders.UserID, Orders.FoodID, Orders.Quantity, Orders.TotalExpense, Orders.OrderDate, Orders.ReportID, Orders.Status, FoodList.FoodName, Users.Username, Orders.ID FROM (Users INNER JOIN Orders ON Users.ID = Orders.UserID) INNER JOIN FoodList ON Orders.FoodID = FoodList.ID ORDER BY Orders.OrderDate;", conn);
         reader = cmd.ExecuteReader();
         while (reader.Read())
         {
             Order o = new Order(reader.GetInt32(0),
                 reader.GetInt32(1),
                 reader.GetInt32(2),
                 reader.GetInt32(3),
                 reader.GetDateTime(4), reader.GetInt32(5), reader.GetString(6), reader.GetString(7), reader.GetString(8), reader.GetInt32(9));
             ol.Add(o);
         }
         reader.Close();
     }
     catch (Exception ex)
     {
         //runs perfectly fine but theres an ERROR. I DONT KNOW WHY --> line 295 (reader.GetInt32(0)) OH NO!
         MessageBox.Show("getOrderList() error: " + ex.ToString());
     }
     return ol;
 }
开发者ID:felixnoriel,项目名称:thesisrepository,代码行数:26,代码来源:DataServices.cs

示例11: GetUsers

 internal static List<User> GetUsers()
 {
     List<User> usersList = new List<User>();
     try
     {
         cmd = new OleDbCommand("SELECT * FROM Users ORDER BY ID;", conn);
         reader = cmd.ExecuteReader();
         while (reader.Read())
         {
             User u = new User(reader.GetInt32(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(4),
                 reader.GetString(5), reader.GetString(6), reader.GetString(7), reader.GetDateTime(8), reader.GetInt32(9), reader.GetInt32(10));
             usersList.Add(u);
         }
         reader.Close();
         return usersList;
     }
     catch (Exception e)
     {
         MessageBox.Show("Error getting usersList: " + e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return null;
     }
 }
开发者ID:felixnoriel,项目名称:thesisrepository,代码行数:22,代码来源:DataServices.cs

示例12: GetAdmins

 internal static List<Admin> GetAdmins()
 {
     List<Admin> adminList = new List<Admin>();
     try
     {
         cmd = new OleDbCommand("SELECT * FROM Admins ORDER BY ID", conn);
         reader = cmd.ExecuteReader();
         while (reader.Read())
         {
             Admin a = new Admin(reader.GetInt32(0), reader.GetString(1), reader.GetString(2), reader.GetString(3),
                 reader.GetString(4), reader.GetString(5), reader.GetString(6), reader.GetString(7));
             adminList.Add(a);
         }
         reader.Close();
         return adminList;
     }
     catch (Exception e)
     {
         MessageBox.Show("Error getting admin list: " + e.Message, "Server Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return null;
     }
 }
开发者ID:felixnoriel,项目名称:thesisrepository,代码行数:22,代码来源:DataServices.cs

示例13: getFoodList

        internal static List<FoodList> getFoodList()
        {
            List<FoodList> fl = new List<FoodList>();
            try
            {
                cmd = new OleDbCommand("SELECT ID, FoodName, FoodPrice, FoodType FROM FoodList ORDER BY FoodName;", conn);
                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    FoodList fudList = new FoodList(reader.GetInt32(0).ToString(), reader.GetString(1), reader.GetInt32(2), reader.GetString(3));
                    fl.Add(fudList);
                }

            }
            catch (Exception ee)
            {
                reader.Close();
                MessageBox.Show("getFoodList() error: " + ee.ToString());
            }
            reader.Close();
            return fl;
        }
开发者ID:felixnoriel,项目名称:thesisrepository,代码行数:22,代码来源:DataServices.cs

示例14: CopyEventToBO

 private EventInfo CopyEventToBO(OleDbDataReader rdr)
 {
     //Id,Title,Type,Audience,Author,EventDate,Description
     EventInfo forumevent = new EventInfo
     {
         Id = rdr.GetInt32(0),
         Title = rdr.SafeGetString(1),
         Type = rdr.GetInt32(2),
         Audience = rdr.SafeGetString(3),
         MemberId = rdr.GetInt32(4),
         Date = rdr.GetSnitzDate(5).Value,
         Description = rdr.SafeGetString(6),
         RecurringFrequency = (RecurringFrequencies) rdr.SafeGetInt32(7)
     };
     var mem = new Member();
     forumevent.Author = new AuthorInfo(mem.GetById(forumevent.MemberId));
     return forumevent;
 }
开发者ID:huwred,项目名称:SnitzDotNet,代码行数:18,代码来源:ForumEvent.cs

示例15: getUserInfo

 public Result getUserInfo(string username)
 {
     Result r = new Result();
     try
     {
         cmd = new OleDbCommand("SELECT * FROM Users WHERE Username = ?;", conn);
         cmd.Parameters.Add("Username", OleDbType.VarChar).Value = username;
         reader = cmd.ExecuteReader();
         if (reader.Read())
         {
             User u = new User(reader.GetInt32(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(4),
                 reader.GetString(5), reader.GetString(6), reader.GetString(7), reader.GetDateTime(8), reader.GetInt32(9), reader.GetInt32(10));
             r.user = u;
             r.success = true;
         }
         return r;
     }
     catch (Exception e)
     {
         MessageBox.Show("Error getting userInfo: " + e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return null;
     }
 }
开发者ID:felixnoriel,项目名称:thesisrepository,代码行数:23,代码来源:DataServices.cs


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