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


C# MySqlDataReader.GetInt32方法代码示例

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


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

示例1: RulesForm_Load

        private void RulesForm_Load(object sender, EventArgs e)
        {
            string time="";
            this.ControlBox = false;

            con.Open();
            cmd = new MySqlCommand("select sum(mark) from test where ecode='" + SelectExam.exam_code + "'", con);
            dr = cmd.ExecuteReader();
            dr.Read();
            cnt = dr.GetInt32(0);
            dr.Close();

               cmd = new MySqlCommand("select duration,tot_quest from exam where eid='" + SelectExam.exam_code + "'", con);
            dr = cmd.ExecuteReader();
            if (dr.Read())
            {
                noquest = dr.GetInt32("tot_quest");
                temp = dr.GetInt32("duration");
                time = (temp.ToString().Length > 1) ? "mins" : "hrs";
                label3.Text = "Duraton of Exam is : " + temp.ToString() + " " + time + "\n\nTotal Number Of Questions : " + noquest+"\n\nMax. Marks : "+cnt;
            }
            else
            {
                MessageBox.Show("Exam Code not selected", "Code Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                this.Hide();
                new SelectExam().Show();
            }
            dr.Close();
            con.Close();
        }
开发者ID:vivek9088,项目名称:Kodemando,代码行数:30,代码来源:RulesForm.cs

示例2: CheckNameAndPasswd

       //when check name and password, get the user's information
       public PropertyClass CheckNameAndPasswd(string name,string password)
       {
           PropertyClass accountClass=null;


       string strSql="select * from account where accountName='"+name.Trim()+"' and accountPassword='"+password.Trim()+"'";
        try{
           sdr=db.GetDataReader(strSql);
            sdr.Read();
            if(sdr.HasRows)
            {
            accountClass=new PropertyClass();
            accountClass.UserId=sdr.GetInt32("id");
            accountClass.AccountName=name.Trim();
            accountClass.AccountPassword=password.Trim();
            accountClass.Email=sdr["email"].ToString();
            accountClass.Job=sdr.GetInt32("job");;
            accountClass.Superviser=sdr.GetInt32("superviser");
            }
        }
           catch(Exception ex)
        {
           
          }
        finally
        {
            sdr.Close();
        }
          return accountClass; 
      
       }
开发者ID:hongbao66,项目名称:ERP,代码行数:32,代码来源:AccountMgr.cs

示例3: Map

 public Favorite Map(MySqlDataReader reader)
 {
     Favorite fav = new Favorite();
     fav.UserId = reader.GetInt32(0);
     fav.PostId = reader.GetInt32(1);
     fav.Annotation = reader.GetString("annotation");
     return fav;
 }
开发者ID:Steven1988,项目名称:portfolio-2,代码行数:8,代码来源:FavoriteMapper.cs

示例4: Map

 public Tag Map(MySqlDataReader reader)
 {
     Tag tag = new Tag();
     tag.Id = reader.GetInt32("id");
     tag.Tagname = reader.GetString("tagname");
     tag.TagCount = reader.IsDBNull(2) ? (int?)null : reader.GetInt32(2);
     return tag;
 }
开发者ID:Steven1988,项目名称:portfolio-2,代码行数:8,代码来源:TagMapper.cs

示例5: readerToStavkaKnjigeTrgovineNaVeliko

 public static StavkaKnjigeTrgovineNaVelikoDTO readerToStavkaKnjigeTrgovineNaVeliko(MySqlDataReader reader)
 {
     StavkaKnjigeTrgovineNaVelikoDTO stavka = new StavkaKnjigeTrgovineNaVelikoDTO();
     stavka.RedniBroj = reader.GetInt32("RedniBroj");
     stavka.PoslovnaGodina = reader.GetInt32("PoslovnaGodina");
     stavka.Datum = reader.GetDateTime("Datum");
     return stavka;
 }
开发者ID:RockLegend93,项目名称:Veleprodaja,代码行数:8,代码来源:MySqlStavkaKnjigeTrgovineNaVeliko.cs

示例6: ProcessRow

 public Session ProcessRow(Session session, MySqlDataReader Reader, int offset)
 {
     session.Id = Reader.GetInt32(0 + offset);
     session.Daytime_id = Reader.GetInt32(1 + offset);
     session.Classroom_id = Reader.GetInt32(2 + offset);
     session.Pair_id = Reader.GetInt32(3 + offset);
     return session;
 }
开发者ID:PAZ-MI4Ie,项目名称:PAZ,代码行数:8,代码来源:SessionMapper.cs

示例7: readerToFilmDTO

 public static FilmDTO readerToFilmDTO(MySqlDataReader reader)
 {
     FilmDTO film = new FilmDTO();
     film.Id = reader.GetInt32("idFilm");
     film.Naziv = reader["nazivFilm"].ToString();
     film.Opis = reader["opisFilm"].ToString();
     film.Trajanje = reader.GetInt32("trajanjeFilm");
     return film;
 }
开发者ID:cupostv,项目名称:e-Bioskop,代码行数:9,代码来源:MySqlFilmDAO.cs

示例8: Map

 public SearchPost Map(MySqlDataReader rdr)
 {
     SearchPost SP = new SearchPost();
     SP.Url = HttpContext.Current.Request.Url.AbsoluteUri + "/"+ rdr.GetInt32("id");
     SP.Id = rdr.GetInt32("id");
     SP.Body = rdr.GetString("body");
     SP.Title = rdr.GetString("title");
     return SP;
 }
开发者ID:Steven1988,项目名称:portfolio-2,代码行数:9,代码来源:PostMapper.cs

示例9: readerToProjekcijaDTO

 public static ProjekcijaDTO readerToProjekcijaDTO(MySqlDataReader reader, SalaDTO sala)
 {
     ProjekcijaDTO projekcija = new ProjekcijaDTO();
     projekcija.Id = reader.GetInt32("idProjekcija");
     projekcija.Vrijeme = reader.GetDateTime("vrijemeProjekcija");
     projekcija.Cijena = reader.GetDouble("cijenaProjekcija");
     projekcija.Film = new MySqlFilmDAO().getById(reader.GetInt32("idFilm"));
     projekcija.Sala = sala;
     return projekcija;
 }
开发者ID:cupostv,项目名称:e-Bioskop,代码行数:10,代码来源:MySqlProjekcijaDAO.cs

示例10: readerToRezervacijaDTO

 public static RezervacijaDTO readerToRezervacijaDTO(MySqlDataReader reader)
 {
     RezervacijaDTO rezervacija = new RezervacijaDTO();
     rezervacija.Id = reader.GetInt32("idRezervacija");
     rezervacija.VrijemeRezervacije = reader.GetDateTime("vrijemeRezervacija");
     rezervacija.Opis = reader["opisRezervacija"].ToString();
     rezervacija.Aktivna = reader.GetInt32("aktivnaRezervacija");
     rezervacija.Zaposleni = MySqlZaposleniDAO.readerToZaposleni(reader);
     return rezervacija;
 }
开发者ID:cupostv,项目名称:e-Bioskop,代码行数:10,代码来源:MySqlRezervacijaDAO.cs

示例11: readerToSalaDTO

 public static SalaDTO readerToSalaDTO(MySqlDataReader reader)
 {
     SalaDTO sala = new SalaDTO();
     sala.Id = reader.GetInt32("idSala");
     sala.Aktivna = reader.GetInt32("aktivna");
     sala.Naziv = reader["nazivSala"].ToString();
     sala.BrojRedova = reader.GetInt32("brojRedova");
     sala.BrojSjedistaURedu = reader.GetInt32("brojSjedistaURedu");
     return sala;
 }
开发者ID:cupostv,项目名称:e-Bioskop,代码行数:10,代码来源:MySqlSalaDAO.cs

示例12: GetUsuario

 public static Usuario GetUsuario(MySqlDataReader rdr)
 {
     if (rdr.IsDBNull(rdr.GetOrdinal("CODUSU"))) return null;
     Usuario u = new Usuario();
     u.CodUsu = rdr.GetInt32("CODUSU");
     u.NomUsu = rdr.GetString("NOMUSU");
     u.Login = rdr.GetString("LOGIN");
     u.PasswordPropio = rdr.GetString("PASSWORD_PROPIO");
     u.NivelAriges = rdr.GetInt32("NIVEL_ARIGES");
     return u;
 }
开发者ID:rafaelgr,项目名称:ArigesMovil,代码行数:11,代码来源:CntAriUs.cs

示例13: GetStudentFromDataReader

        protected Student GetStudentFromDataReader(MySqlDataReader dataReader)
        {
            int studentenID = dataReader.GetInt32("student_id");
            string naam = dataReader.GetString("studentnaam");
            DateTime geboorteDatum = dataReader.GetDateTime("geboortedatum");
            int studiePunten = dataReader.GetInt32("studiepunten");

            Student student = new Student { ID = studentenID, Naam = naam, GeboorteDatum = geboorteDatum, StudiePunten = studiePunten };

            return student;
        }
开发者ID:CVD95,项目名称:WebshopDierenwinkel,代码行数:11,代码来源:DatabaseController.cs

示例14: LoadFromDB

        public void LoadFromDB(MySqlDataReader reader)
        {
            Decks.ForEach(v => v.Clear());

            while (reader.Read())
            {
                DeckType deckType = (DeckType)reader.GetInt32(0);
                Int32 slotNo = reader.GetInt16(1);
                Int32 characterNo = reader.GetInt32(2);

                this[deckType].Characters[slotNo] = _user.InvenCharacter.Find(characterNo);
            }
        }
开发者ID:SyncZone,项目名称:Examples,代码行数:13,代码来源:PlayDeck.cs

示例15: getFullAdresFromDataReader

 // Haal adres van klanten binnen
 protected Adres getFullAdresFromDataReader(MySqlDataReader datareader)
 {
     Adres adres = new Adres
     {
         Id = datareader.GetInt32("adresId"),
         Straat = datareader.GetString("straat"),
         Postcode = datareader.GetString("postcode"),
         Huisnummer = datareader.GetInt32("huisnummer"),
         HuisnummerToevoegsel = String.IsNullOrEmpty(datareader["huisnummertoevoeging"].ToString()) ? "Geen" : datareader.GetString("huisnummertoevoeging"),
         Stad = datareader.GetString("stad"),
     };
     return adres;
 }
开发者ID:RichTee,项目名称:INFZ-C-Project,代码行数:14,代码来源:DatabaseController.cs


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