本文整理汇总了C#中MySql.Data.MySqlClient.MySqlDataReader类的典型用法代码示例。如果您正苦于以下问题:C# MySqlDataReader类的具体用法?C# MySqlDataReader怎么用?C# MySqlDataReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MySqlDataReader类属于MySql.Data.MySqlClient命名空间,在下文中一共展示了MySqlDataReader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TableInformations
public TableInformations(MySqlDataReader reader)
{
_primaryKey = new List<string>();
_uniqueConstraints = new List<string>();
_foreignConstraints = new List<string>();
this.setProperty(reader);
}
开发者ID:karpediemnow,项目名称:mysql-class-generator,代码行数:7,代码来源:TableInformations.cs
示例2: show
public static void show(MySqlDataReader mySqlDataReader)
{
// METODO QUE MUESTRA TODO EL CONETNIDO DE LA TABLA
Console.WriteLine ("FILAS : "); // EL SHOW MUESTRA EL SHOWROW (FILA). EL SHOWROW MUESTRA LA FILA
while (mySqlDataReader.Read())
showRow (mySqlDataReader);
}
开发者ID:skounah,项目名称:2DAM-AD,代码行数:7,代码来源:Program.cs
示例3: GetGameFromDataReader
protected Game GetGameFromDataReader(MySqlDataReader dataReader)
{
string gameNaam = dataReader.GetString("gamenaam");
int gameId = dataReader.GetInt32("game_id");
Game game = new Game { ID = gameId, Naam = gameNaam };
return game;
}
开发者ID:CVD95,项目名称:WebshopDierenwinkel,代码行数:7,代码来源:DatabaseController.cs
示例4: InitFromData
public void InitFromData(MySqlDataReader reader)
{
Id = (int)reader["id"];
Ip = (string)reader["ip"];
Port = (int)reader["port"];
Status = ServerStatusEnum.OFFLINE;
}
开发者ID:Riul,项目名称:emulator,代码行数:7,代码来源:ServerModel.cs
示例5: readerToRobaDTO
public static RobaDTO readerToRobaDTO(MySqlDataReader reader)
{
RobaDTO roba = new RobaDTO();
roba.SifraRoba = reader.GetInt32("SifraRoba");
roba.Naziv = reader.GetString("Naziv");
return roba;
}
开发者ID:RockLegend93,项目名称:Veleprodaja,代码行数:7,代码来源:MySqlRobaDAO.cs
示例6: DataReaderToDataTable
public System.Data.DataTable DataReaderToDataTable(MySqlDataReader Reader)
{
System.Data.DataTable dt = new System.Data.DataTable();
System.Data.DataColumn dc;
System.Data.DataRow dr;
ArrayList arr = new ArrayList();
int i;
for(i=0;i<Reader.FieldCount;i++)
{
dc = new System.Data.DataColumn();
dc.ColumnName = Reader.GetName(i);
arr.Add(dc.ColumnName);
dt.Columns.Add(dc);
}
while(Reader.Read())
{
dr = dt.NewRow();
for (i=0;i<Reader.FieldCount;i++)
{
dr[(string)arr[i]] = Reader[i].ToString();
}
dt.Rows.Add(dr);
}
Reader.Close();
return dt;
}
开发者ID:marioricci,项目名称:erp-luma,代码行数:32,代码来源:DataClass.cs
示例7: GetSchemaForQuery
/// <summary>
/// Gets schema from reader taking Query.ResultRowType in consideration
/// </summary>
public static Schema GetSchemaForQuery(string target, Query query, MySqlDataReader reader, QuerySource qSource, out Schema.FieldDef[] toLoad)
{
Schema schema;
var rtp = query.ResultRowType;
if (rtp != null && typeof(TypedRow).IsAssignableFrom(rtp))
schema = Schema.GetForTypedRow(query.ResultRowType);
else
schema = GetSchemaFromReader(query.Name, qSource, reader);
//determine what fields to load
toLoad = new Schema.FieldDef[reader.FieldCount];
for (int i = 0; i < reader.FieldCount; i++)
{
var name = reader.GetName(i);
var fdef = schema[name];
//todo A gde GetBackendNameFor target?
if (fdef==null) continue;
var attr = fdef[target];
if (attr!=null)
{
if (attr.StoreFlag!=StoreFlag.LoadAndStore && attr.StoreFlag!=StoreFlag.OnlyLoad) continue;
}
toLoad[i] = fdef;
}
return schema;
}
开发者ID:itadapter,项目名称:nfx,代码行数:32,代码来源:MySQLCRUDScriptQueryHandler.cs
示例8: show
private static void show(MySqlDataReader mySqlDataReader)
{
Console.WriteLine ("show");
while (mySqlDataReader.Read()) {
showRow (mySqlDataReader);
}
}
开发者ID:luisso96,项目名称:ad,代码行数:7,代码来源:Program.cs
示例9: readerToStatusFilmDTO
public static StatusFilmDTO readerToStatusFilmDTO(MySqlDataReader reader)
{
StatusFilmDTO status = new StatusFilmDTO();
status.Id = reader.GetInt32("idStatusFilm");
status.Naziv = reader["nazivStatusFilm"].ToString();
return status;
}
开发者ID:cupostv,项目名称:e-Bioskop,代码行数:7,代码来源:MySqlStatusFilmDAO.cs
示例10: getColumnNames
//metodo que devuelve un array con el nombre de las columnas de la tabla que contiene el mySqlDataReader
private string[] getColumnNames(MySqlDataReader mySqlDataReader)
{
List<string> columnNames = new List<string>();//Lista de valores que almacenara el nombre de las columnas de la tabla en la base de datos
for (int index = 0; index < mySqlDataReader.FieldCount; index++)//se obtienen del mySqlDataReader el nombre de las columnas
columnNames.Add (mySqlDataReader.GetName (index));//se añade el nombre a la lista
return columnNames.ToArray ();
}
开发者ID:CristianAguerreClavel,项目名称:ad,代码行数:8,代码来源:MainWindow.cs
示例11: rdrParse
private static ContractType rdrParse(MySqlDataReader rdr)
{
return new ContractType {
Id = rdr.GetInt32 ("id"),
Name = rdr.GetString ("name")
};
}
开发者ID:QualitySolution,项目名称:LeaseAgreement,代码行数:7,代码来源:ContractType.cs
示例12: SetUp
public override void SetUp(MySqlDataReader reader)
{
this.ProductTypeName = reader["UsingProductType"].ToString();
this.RollingStockType = reader["OnRollingStockType"].ToString();
this.IndustryName = reader["ForIndustry"].ToString();
this.isProducer = (bool)reader["IsProducer"];
}
开发者ID:tbdye,项目名称:css475,代码行数:7,代码来源:Product.cs
示例13: FillFields
public override void FillFields(MySqlDataReader reader)
{
EventId = (long)reader["EventId"];
EventTime = (long)reader["EventTime"];
EventName = (Logger.EventLogNames)Enum.Parse(typeof(Logger.EventLogNames), reader["EventName"].ToString());
EventData = reader["EventData"].ToString();
}
开发者ID:reemsherman,项目名称:GroupBattleBackend,代码行数:7,代码来源:Log.cs
示例14: findAll
public void findAll()
{
db = new Database();
brands.Clear();
brandQuery = new MySqlCommand();
brandQuery.Connection = db.Connection();
brandQuery.CommandText = "SELECT * FROM brand ORDER BY brandname ASC";
this.brandResult = brandQuery.ExecuteReader();
while (brandResult.Read())
{
if (!brandResult.IsDBNull(0))
{
idbrand = brandResult.GetInt32(0);
}
if (!brandResult.IsDBNull(1))
{
brandname = brandResult.GetString(1);
}
brands.Add(new Brand { idbrand = this.idbrand, brandname = this.brandname});
}
db.Close();
}
开发者ID:JoseMariaAndrade,项目名称:VeneporteProject,代码行数:31,代码来源:Brand.cs
示例15: button1_Click
private void button1_Click(object sender, EventArgs e)
{
string pwss = textBox1.Text.ToString();
string confirm = textBox2.Text.ToString();
if (pwss == confirm)
{
if (this.textBox3.Text.ToString() == usuario_activo.pw)
{
sentenciaSQL = "UPDATE sql28127.usuarios SET pw='" + this.textBox2.Text + "' where id_usuario= '" + usuario_activo.id + "' ;";
// sentenciaSQL = "UPDATE test.usuarios SET pw='" + this.textBox2.Text + "' where id_usuario= '" + usuario_activo.id + "' ;";
comando = new MySqlCommand(sentenciaSQL, conexion);
resultado = comando.ExecuteReader();
MessageBox.Show("Cambio completado", "Aceptado");
this.Close();
Form3 principal = new Form3();
principal.Show();
}
else
{
MessageBox.Show("Tercer campo \"Repetir Contraseña\" erroneo", "ERROR");
}
}
else
{
MessageBox.Show("Igualar Contraseñas", "ERROR");
}
}
开发者ID:EugenioAM,项目名称:PracticaProgramacionEscorpiones,代码行数:30,代码来源:Form6.cs
示例16: 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
示例17: IsNameExist
public bool IsNameExist(string name)
{
string strSql="select * from account where accountName='"+name.Trim()+"'";
try{
sdr=db.GetDataReader(strSql);
sdr.Read();
if(sdr.HasRows)
{
sdr.Close();
return true;
}
else
{
sdr.Close();
return false;
}
}
catch(Exception e)
{
}
finally
{
sdr.Close();
}
return true;
}
开发者ID:hongbao66,项目名称:ERP,代码行数:28,代码来源:AccountMgr.cs
示例18: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
topics_ids = new ArrayList();
dbConnection = new MySqlConnection(ConfigurationManager.AppSettings["ConnectionString"].ToString());
dbConnection.Open();
slctTopics = new MySqlCommand("SELECT t_id FROM topics", dbConnection);
dReaderTopics = slctTopics.ExecuteReader();
while (dReaderTopics.Read())
{
topics_ids.Add(dReaderTopics[0].ToString());
counter++;
}
dReaderTopics.Close();
slctTopics.Dispose();
while (i < counter)
{
updtTopicsNumberOfVideos = new MySqlCommand("UPDATE topics SET t_nb_videos=(SELECT count(*) FROM videos WHERE t_id=" + topics_ids[i].ToString() + ") WHERE t_id=" + topics_ids[i].ToString(), dbConnection);
updtTopicsNumberOfVideos.ExecuteNonQuery();
updtTopicsNumberOfVideos.Dispose();
i++;
}
}
开发者ID:mrhanti,项目名称:getiteasy,代码行数:27,代码来源:Update.aspx.cs
示例19: BuscarIdPlanoDeMarketing
//funcionando
public int BuscarIdPlanoDeMarketing(int IdPlano)
{
try
{
string QueryPesquisarIdSumario = "select * from planodemarketing where [email protected];";
int idSumario = 0;
Dal.ConectarBanco();
ComandoPesquisarIdPlanoDeMarketing = new MySqlCommand(QueryPesquisarIdSumario);
ComandoPesquisarIdPlanoDeMarketing.Connection = Dal.Conn;
ComandoPesquisarIdPlanoDeMarketing.Parameters.AddWithValue("@IdPlano", IdPlano);
ReaderPEsquisarIdPlanoDeMarketing = ComandoPesquisarIdPlanoDeMarketing.ExecuteReader();
while (ReaderPEsquisarIdPlanoDeMarketing.Read())
{
idSumario = int.Parse(ReaderPEsquisarIdPlanoDeMarketing["id"].ToString());
}
return idSumario;
}
catch
{
int idSumario = 0;
return idSumario;
}
finally
{
ReaderPEsquisarIdPlanoDeMarketing.Close();
Dal.FecharConexao();
}
}
开发者ID:diegolinkk,项目名称:SimuladorDeNegocios,代码行数:33,代码来源:PlanoDeMarketingDAL.cs
示例20: LoadSector
public List<Sector> LoadSector()
{
try
{
using (MySqlConnection cn = new MySqlConnection((clsCon=new Connection(this.user)).Parameters()))
{
listSec = new List<Sector>();
cn.Open();
sql = "select * from asada.view_sectores";
cmd = new MySqlCommand(sql, cn);
reader = cmd.ExecuteReader();
while (reader.Read())
{
sec = new Sector();
sec.Code = reader.GetString(0);
sec.Consecutive = reader.GetInt32(1);
sec.Description = reader.GetString(2);
listSec.Add(sec);
}
reader.Close();
return listSec;
}
}
catch (Exception)
{
throw;
}
}
开发者ID:MBLopez,项目名称:Asada07,代码行数:28,代码来源:SectorDAO.cs
注:本文中的MySql.Data.MySqlClient.MySqlDataReader类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论