本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}