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


C# MySqlDataReader.GetDouble方法代码示例

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


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

示例1: Mapper

 public static Champion Mapper(MySqlDataReader r)
 {
     var c = new Champion();
     c.Id = r.GetInt32("Id");
     c.Name = r.GetString("Name");
     c.Title = r.GetString("Title");
     c.Stat = new Stat();
     c.Stat.Mana = r.GetDouble("Mana");
     c.Stat.ManaPerLv = r.GetDouble("ManaPerLevel");
     c.Stat.MagicResist = r.GetDouble("MagicResist");
     c.Stat.MagicResistPerLv = r.GetDouble("MagicResistPerLevel");
     return c;
 }
开发者ID:maxirejlis,项目名称:APitems-LOL,代码行数:13,代码来源:Champion.cs

示例2: DBColumnToPyObject

        public static PyObject DBColumnToPyObject(int index, ref MySqlDataReader reader)
        {
            Type type = reader.GetFieldType(index);

            switch (type.Name)
            {
                case "String":
                    return new PyString(reader.GetString(index));
                case "UInt32":
                case "Int32":
                case "UInt16":
                case "Int16":
                case "SByte":
                case "Byte":
                    return new PyInt(reader.GetInt32(index));
                case "UInt64":
                case "Int64":
                    return new PyLongLong(reader.GetInt64(index));
                case "Byte[]":
                    return new PyBuffer((byte[])reader.GetValue(index));
                case "Double":
                    return new PyFloat(reader.GetDouble(index));
                case "Decimal":
                    return new PyFloat((double)reader.GetDecimal(index));
                case "Boolean":
                    return new PyBool(reader.GetBoolean(index));
                default:
                    Log.Error("Database", "Unhandled MySQL type " + type.Name);
                    break;
            }

            return null;
        }
开发者ID:Reve,项目名称:EVESharp,代码行数:33,代码来源:DBUtils.cs

示例3: readerToProjekcijaDTO

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

示例4: execReader

 public FinanceiroType execReader(MySqlDataReader dr)
 {
     FinanceiroType type = new FinanceiroType();
     type.IdFinanceiro = Convert.ToInt32(dr["id_financeiro"].ToString());
     type.IdAssociacao = Convert.ToInt32(dr["id_associacao"].ToString());
     type.Titulo = dr["titulo"].ToString();
     type.Valor = dr.GetDouble("valor");
     type.Data = dr["data"].ToString();
     type.Tipo = dr["tipo"].ToString();
     return type;
 }
开发者ID:paulocoliver,项目名称:projeto-elvis,代码行数:11,代码来源:FinanceiroDAL.cs

示例5: readerToStavkaOtpremniceDTO

 public static StavkaOtpremniceDTO readerToStavkaOtpremniceDTO(MySqlDataReader reader)
 {
     StavkaOtpremniceDTO stavka = new StavkaOtpremniceDTO();
     stavka.Kolicina = reader.GetDouble("Kolicina");
     stavka.VeleprodajnaCijena = reader.GetDouble("VeleprodajnaCijena");
     stavka.Rabat = reader.GetDouble("Rabat");
     stavka.CijenaSaRabatom = reader.GetDouble("CijenaSaRabatom");
     stavka.IznosSaRabatom = reader.GetDouble("IznosSaRabatom");
     stavka.VeleprodajniIznos = reader.GetDouble("VeleprodajniIznos");
     return stavka;
 }
开发者ID:RockLegend93,项目名称:Veleprodaja,代码行数:11,代码来源:MySqlStavkaOtpremniceDAO.cs

示例6: getProductDetailFromDataReader

        protected ProductDetail getProductDetailFromDataReader(MySqlDataReader datareader)
        {

            ProductDetail productDetail = new ProductDetail
            {
                detailId = datareader.GetInt32("detailID"),
                verkoopprijs = datareader.GetDouble("verkoopprijs"),
                inkoopprijs = datareader.GetDouble("inkoopprijs"),
                maatId = datareader.GetInt32("maatId"),
                voorraad = datareader.GetInt32("voorraad"),
            };
            return productDetail;
        }
开发者ID:RichTee,项目名称:INFZ-C-Project,代码行数:13,代码来源:DatabaseController.cs

示例7: readerToStavkaKalkulacijeDTO

 private StavkaKalkulacijeDTO readerToStavkaKalkulacijeDTO(MySqlDataReader reader)
 {
     StavkaKalkulacijeDTO stavka = new StavkaKalkulacijeDTO();
     stavka.Kolicina = reader.GetDouble("Kolicina");
     stavka.NabavnaCijena = reader.GetDouble("NabavnaCijena");
     stavka.Rabat = reader.GetDouble("Rabat");
     stavka.NetoNabavnaCijena = reader.GetDouble("NetoNabavnaCijena");
     stavka.VeleprodajnaCijena = reader.GetDouble("VeleprodajnaCijena");
     stavka.RazlikaUCijeni = reader.GetDouble("RazlikaUCijeni");
     stavka.NabavnaVrijednost = reader.GetDouble("NabavnaVrijednost");
     stavka.VeleprodajnaVrijednost = reader.GetDouble("VeleprodajnaVrijednost");
     return stavka;
 }
开发者ID:RockLegend93,项目名称:Veleprodaja,代码行数:13,代码来源:MySqlStavkaKalkulacijeDAO.cs

示例8: Mapper

 public static Rune Mapper(MySqlDataReader reader)
 {
     var r = new Rune();
     r.Id = reader.GetInt32("Id");
     r.Name = reader.GetString("Name");
     r.Ap = reader.GetDouble("Ap");
     r.ApPerLevel = reader.GetDouble("ApPerLevel");
     r.Mana = reader.GetDouble("Mana");
     r.ManaPerLevel = reader.GetDouble("ManaPerLevel");
     r.MagicResist = reader.GetDouble("MagicResist");
     r.MagicResistPerLevel = reader.GetDouble("MagicResistPerLevel");
     r.MagicPenetrationFlat = reader.GetDouble("MagicPenetrationFlat");
     return r;
 }
开发者ID:maxirejlis,项目名称:APitems-LOL,代码行数:14,代码来源:Rune.cs

示例9: cb_Agregar_SelectedIndexChanged

        private void cb_Agregar_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (rb_Materiales.Checked == true)
            {

                query = "SELECT Codigo, Descripcion, Unidad, Costo, Rendimiento, Importe FROM listapu.materiales WHERE Codigo = '" + cb_Agregar.Text + "';";
                con = new MySqlConnection(constring);
                cmd = new MySqlCommand(query, con);
                con.Open();
                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    string Codigo = reader.GetString("Codigo");
                    string Descripcion = reader.GetString("Descripcion");
                    string Unidad = reader.GetString("Unidad");
                    double Costo = reader.GetDouble("Costo");
                    double Rendimiento = reader.GetDouble("Rendimiento");
                    double Importe = reader.GetDouble("Importe");

                    txtCodigo.Text = Codigo;
                    txtDesc.Text = Descripcion;
                    txtUnidad.Text = Unidad;
                    txtCosto.Text = Costo.ToString("0.##");

                    lbl_Ocupacion.Visible = false;
                    lbl_Descripcion.Visible = true;
                    lbl_Sueldo.Visible = false;
                    lbl_Costo.Visible = true;
                    lbl_Salario.Visible = false;
                    lbl_CostoHr.Visible = false;
                }
                con.Close();
            }
            else
                if (rB_ManodeObra.Checked == true)
                {
                    query = "SELECT Codigo, Ocupacion, SueldoSemanalVigente, SalarioTotal, Rendimiento, Importe FROM listapu.manodeobra WHERE Codigo = '" + cb_Agregar.Text + "';";
                    con = new MySqlConnection(constring);
                    cmd = new MySqlCommand(query, con);
                    con.Open();
                    reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        string Codigo = reader.GetString("Codigo");
                        string ocupacion = reader.GetString("Ocupacion");
                        double Sueldo = reader.GetDouble("SueldoSemanalVigente");
                        double Salario = reader.GetDouble("SalarioTotal");
                        double Rendimiento = reader.GetDouble("Rendimiento");
                        double Importe = reader.GetDouble("Importe");

                        txtCodigo.Text = Codigo;
                        txtDesc.Text = ocupacion;
                        txtUnidad.Text = Sueldo.ToString("0.##");
                        txtCosto.Text = Salario.ToString("0.##");
                    }
                    con.Close();
                    lbl_Ocupacion.Visible = true;
                    lbl_Descripcion.Visible = false;
                    lbl_Sueldo.Visible = true;
                    lbl_Costo.Visible = false;
                    lbl_Salario.Visible = true;
                    lbl_CostoHr.Visible = false;
                }
                else
                    if (rB_EqMaq.Checked == true)
                    {
                        query = "SELECT Codigo, Descripcion, Unidad, CostoHr, Rendimiento, Importe FROM listapu.equipo WHERE Codigo = '" + cb_Agregar.Text + "';";
                        con = new MySqlConnection(constring);
                        cmd = new MySqlCommand(query, con);
                        con.Open();
                        reader = cmd.ExecuteReader();
                        while (reader.Read())
                        {
                            string Codigo = reader.GetString("Codigo");
                            string Descripcion = reader.GetString("Descripcion");
                            string Unidad = reader.GetString("Unidad");
                            double Costo = reader.GetDouble("CostoHr");
                            double Rendimiento = reader.GetDouble("Rendimiento");
                            double Importe = reader.GetDouble("Importe");

                            txtCodigo.Text = Codigo;
                            txtDesc.Text = Descripcion;
                            txtUnidad.Text = Unidad;
                            txtCosto.Text = Costo.ToString("0.##");
                        }
                        con.Close();
                        lbl_Ocupacion.Visible = false;
                        lbl_Descripcion.Visible = true;
                        lbl_Sueldo.Visible = false;
                        lbl_Costo.Visible = false;
                        lbl_Salario.Visible = false;
                        lbl_CostoHr.Visible = true;
                    }
        }
开发者ID:ErikaDL,项目名称:APU09Arquitectura,代码行数:94,代码来源:Agregar.cs

示例10: QueryDB

    IEnumerator QueryDB(float seconds)
    {
        double xDiff, yDiff, xNewPos, yNewPos;

        // My Nexus 5
        //string query = "SELECT x, y from devicelocations where deviceID = '4192fe2d3b7fbf27';";
        //string query = "SELECT i, j, virtual from devicelocations where deviceID = '4192fe2d3b7fbf27';";

        //***
        //string query = "SELECT i, j from devicelocations where deviceID = '4192fe2d3b7fbf27';";
        string query = "SELECT i, j from devicelocations";

        //Group's Nexus 4
        //string query = "SELECT x, y from devicelocations where deviceID = 'c76129348d8acd2e';";
        //string query = "SELECT i, j, virtual from devicelocations where deviceID = 'c76129348d8acd2e';";

        while (true) {

            try {
                if (con.State.CompareTo(ConnectionState.Open) != 0) {
                    con.Open(); //this line causes the windows-1252 encoding error if I18N DLLs are not included, even though it only OPENS the connection & hasn't actually requested any data yet (easy solution - include the I18N DLLs)
                }
                using (con) {
                    using (cmd = new MySqlCommand(query, con)) {
                        read = cmd.ExecuteReader();
                        while (read.Read()) {
                            for (int i = 0; i < read.FieldCount; i++) {

                                //xDiff = Math.Abs(read.GetDouble(0) - anchorAtlasX);
                                xDiff = Math.Abs((read.GetDouble(0) - anchorAtlasI));
                                Double xDiffMeters = xDiff / pixelsPerMeter;

                                //yDiff = Math.Abs(read.GetDouble(1) - anchorAtlasY);
                                yDiff = Math.Abs((read.GetDouble(1) - anchorAtlasJ));
                                Double yDiffMeters = yDiff / pixelsPerMeter;

                                //virt = (read.GetBoolean(2));
                                //Debug.Log("virt flag: " + virt);

                                //if (read.GetDouble(0) > anchorAtlasX)
                                if (read.GetDouble(0) > anchorAtlasI) {
                                    //xNewPos = anchorUnityX + xDiff;
                                    xNewPos = anchorUnityX + xDiffMeters;
                                }
                                else {
                                    //xNewPos = anchorUnityX - xDiff;
                                    xNewPos = anchorUnityX - xDiffMeters;
                                }

                                //if (read.GetDouble(1) > anchorAtlasY)
                                if (read.GetDouble(1) > anchorAtlasJ) {
                                    //yNewPos = anchorUnityY - yDiff;
                                    yNewPos = anchorUnityY - yDiffMeters;
                                }
                                else {
                                    //yNewPos = anchorUnityY + yDiff;
                                    yNewPos = anchorUnityY + yDiffMeters;
                                }

                                // Vector of NewPoint
                                newPos = new Vector3((float)xNewPos, (float)transform.position.y, (float)yNewPos);

                                //Debug.Log("New Vector3: " + newPos.x + ", " + newPos.y + ", " + newPos.z);

                                // Actual transform (movement) code is in update() as that runs every frame whereas this method only runs every x seconds (it's a coroutine with WaitForSeconds at the end)
                            }
                        }
                    }
                }
            }
            catch (Exception e) {
                Debug.Log(e.ToString());
            }
            //Debug.Log("DB query on: " + System.DateTime.Now);
            yield return new WaitForSeconds(seconds);
        }
    }
开发者ID:onlylemi,项目名称:Mirrorshades,代码行数:77,代码来源:NewPointScript.cs

示例11: getDouble

 public static double? getDouble(MySqlDataReader dr, string column)
 {
     int ordinal = dr.GetOrdinal(column);
     if (dr.IsDBNull(ordinal))
     {
         return null;
     }
     else
     {
         return dr.GetDouble(ordinal);
     }
 }
开发者ID:santoshpisipati,项目名称:you-global,代码行数:12,代码来源:DataAccess.cs

示例12: Tube_Control

        public void Tube_Control(TreeViewItem item)
        {
            try
            {
                if (item.Tag.ToString() == "tube0" || item.Tag.ToString() == "tube1")
                {
                    Mouse.OverrideCursor = Cursors.Wait;
                    _mySqlCommand.CommandText = @"
                        SELECT
                        defectsdata.IndexData,
                        defectsdata.NumberPart,
                        defectsdata.NumberTube,
                        defectsdata.NumberSegments,
                        defectsdata.DataSensors,
                        DATE_FORMAT(defectsdata.DatePr, '%Y-%m-%d'),
                        defectsdata.TimePr,
                        worksmens.NameSmen,
                        o1.Surname,
                        o2.Surname
                        FROM
                        defectsdata
                        INNER JOIN indexes ON indexes.IndexData = defectsdata.IndexData
                        INNER JOIN worksmens ON worksmens.Id_WorkSmen = indexes.Id_WorkSmen
                        INNER JOIN operators o1 ON o1.Id_Operator = indexes.Id_Operator1
                        INNER JOIN operators o2 ON o2.Id_Operator = indexes.Id_Operator2
                        WHERE
                        defectsdata.IndexData = @A
                        LIMIT 1
                    ";
                    _mySqlCommand.Parameters.Clear();
                    _mySqlCommand.Parameters.AddWithValue("A", item.Uid);

                    _mySqlCommand.Connection = _connection.MySqlConnection;
                    _mySqlDataReader = _mySqlCommand.ExecuteReader();

                    while (_mySqlDataReader.Read())
                    {
                        ArchiveWindow.label1.Content = "Номер плавки\t" + _mySqlDataReader.GetString(1);
                        ArchiveWindow.label2.Content = "Номер трубы\t" + _mySqlDataReader.GetString(2);
                        ArchiveWindow.label3.Content = "Дата проведения Н.К.\t" + _mySqlDataReader.GetString(5);
                        ArchiveWindow.label4.Content = "Время проведения Н.К.\t" + _mySqlDataReader.GetString(6);
                        ArchiveWindow.label5.Content = "Длина трубы (метры)\t\t " +
                                                       Math.Round((_mySqlDataReader.GetDouble(3)/6), 2);
                        ArchiveWindow.label7.Content = "Рабочая смена\t" + _mySqlDataReader.GetString(7);
                        ArchiveWindow.label8.Content = "Специалист ОКПП\t" + _mySqlDataReader.GetString(9);
                        ArchiveWindow.label9.Content = "Специалист АСК ТЭСЦ-2\t" + _mySqlDataReader.GetString(8);

                        for (var i = 0; i < _countDeffectsLine; i++)
                        {
                            var line = (Line) ArchiveWindow.canvas1.FindName("errorLine" + i);
                            ArchiveWindow.canvas1.Children.Remove(line);
                            try
                            {
                                ArchiveWindow.canvas1.UnregisterName("errorLine" + i);
                            }
                                // ReSharper disable EmptyGeneralCatchClause
                            catch
                                // ReSharper restore EmptyGeneralCatchClause
                            {
                            }
                        }
                        _countDeffectsLine = 0;

                        /*_mySqlDataReaderValue4 = _mySqlDataReader.GetValue(4);
                        _da.Completed += _da_Completed;
                        _da.From = ArchiveWindow.rectangle1.Width;
                        _da.To = _mySqlDataReader.GetDouble(3)*4;
                        _da.Duration = TimeSpan.FromMilliseconds(500);
                        ArchiveWindow.rectangle1.BeginAnimation(FrameworkElement.WidthProperty, _da);*/
                        ArchiveWindow.rectangle1.Width = _mySqlDataReader.GetDouble(3)*4;

                        var j = 0;

                        foreach (var deffect in (byte[]) _mySqlDataReader.GetValue(4))
                        {
                            if (deffect != 0)
                            {
                                var redBrush = new SolidColorBrush
                                {
                                    Color = Colors.Red
                                };

                                var errorLine = new Line();

                                Canvas.SetLeft(errorLine, 40 + (j*4));
                                errorLine.Opacity = 1;
                                errorLine.X1 = 0;
                                errorLine.X2 = 0;
                                errorLine.Y1 = 151;
                                errorLine.Y2 = 151 + 70;
                                errorLine.StrokeThickness = 4;
                                errorLine.Stroke = redBrush;
                                errorLine.Fill = redBrush;
                                ArchiveWindow.canvas1.RegisterName("errorLine" + _countDeffectsLine, errorLine);
                                ArchiveWindow.canvas1.Children.Add(errorLine);
                                /*_da1.From = 0;
                                _da1.To = 1;
                                _da1.Duration = TimeSpan.FromMilliseconds(2000);
                                errorLine.BeginAnimation(UIElement.OpacityProperty, _da1);*/
                                _countDeffectsLine++;
//.........这里部分代码省略.........
开发者ID:Nazgard,项目名称:t2_1stan,代码行数:101,代码来源:ArchiveControl.cs

示例13: Change

        public void Change(string columnas, string bd, int rB)
        {
            query = "SELECT " + columnas + " FROM " + bd + " WHERE Codigo = '" + cb_Agregar.Text + "';";
            try
            {
                if (rB == 1)
                {
                    con = new MySqlConnection(constring);
                    cmd = new MySqlCommand(query, con);
                    con.Open();
                    reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        string Codigo = reader.GetString("Codigo");
                        string Descripcion = reader.GetString("Descripcion");
                        string Unidad = reader.GetString("Unidad");
                        double Costo = reader.GetDouble("Costo");
                        double Rendimiento = reader.GetDouble("Rendimiento");
                        double Importe = reader.GetDouble("Importe");

                        txtCodigo.Text = Codigo;
                        txtDesc.Text = Descripcion;
                        txtUnidad.Text = Unidad;
                        txtCosto.Text = Costo.ToString("0.##");
                    }
                    con.Close();
                    lbl_Ocupacion.Visible = false;
                    lbl_Descripcion.Visible = true;
                    lbl_Sueldo.Visible = false;
                    lbl_Costo.Visible = true;
                    lbl_Salario.Visible = false;
                    lbl_CostoHr.Visible = false;
                }
                else
                    if (rB == 2)
                    {
                        con = new MySqlConnection(constring);
                        cmd = new MySqlCommand(query, con);
                        con.Open();
                        reader = cmd.ExecuteReader();
                        while (reader.Read())
                        {
                            string Codigo = reader.GetString("Codigo");
                            string ocupacion = reader.GetString("Ocupacion");
                            double Sueldo = reader.GetDouble("SueldoSemVig");
                            double Salario = reader.GetDouble("SalarioTotal");
                            double Rendimiento = reader.GetDouble("Rendimiento");
                            double Importe = reader.GetDouble("Importe");

                            txtCodigo.Text = Codigo;
                            txtDesc.Text = ocupacion;
                            txtUnidad.Text = Sueldo.ToString("0.##");
                            txtCosto.Text = Salario.ToString("0.##");
                        }
                        con.Close();
                        lbl_Ocupacion.Visible = true;
                        lbl_Descripcion.Visible = false;
                        lbl_Sueldo.Visible = true;
                        lbl_Costo.Visible = false;
                        lbl_Salario.Visible = true;
                        lbl_CostoHr.Visible = false;
                    }
                    else
                        if (rB == 3)
                        {
                            con = new MySqlConnection(constring);
                            cmd = new MySqlCommand(query, con);
                            con.Open();
                            reader = cmd.ExecuteReader();
                            while (reader.Read())
                            {
                                string Codigo = reader.GetString("Codigo");
                                string Descripcion = reader.GetString("Descripcion");
                                string Unidad = reader.GetString("Unidad");
                                double Costo = reader.GetDouble("CostoHr");
                                double Rendimiento = reader.GetDouble("Rendimiento");
                                double Importe = reader.GetDouble("Importe");

                                txtCodigo.Text = Codigo;
                                txtDesc.Text = Descripcion;
                                txtUnidad.Text = Unidad;
                                txtCosto.Text = Costo.ToString("0.##");
                            }
                            con.Close();
                            lbl_Ocupacion.Visible = false;
                            lbl_Descripcion.Visible = true;
                            lbl_Sueldo.Visible = false;
                            lbl_Costo.Visible = false;
                            lbl_Salario.Visible = false;
                            lbl_CostoHr.Visible = true;
                        }

            }
            catch
            {
                MessageBox.Show("Error en la conexión de la Base de Datos", "Ocurrió un error",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
开发者ID:ErikaDL,项目名称:APU09Arquitectura,代码行数:99,代码来源:Agregar.cs

示例14: Unique_GetListOfIds

        public List<string> Unique_GetListOfIds(string table)
        {
            List<string> idList = new List<string>();

            cmd = new MySqlCommand("SELECT distinct(id) FROM " + Database + "." + table, connection);
            reader = cmd.ExecuteReader();
            while (reader.Read())
            {
                idList.Add(reader.GetDouble(0).ToString());
            }
            reader.Close();

            return idList;
        }
开发者ID:KDRS-SA,项目名称:IKAVA-Systembehandler,代码行数:14,代码来源:MySqlConnector.cs

示例15: SetFromSql

        /// <summary>
        /// Populate object from database record
        /// </summary>
        /// <param name="reader">
        /// A <see cref="MySqlDataReader"/>
        /// </param>
        public void SetFromSql(MySqlDataReader reader)
        {
            for (int i = 0; i < reader.FieldCount; i++) {
                switch (reader.GetName(i)) {
                    case "id": Id = reader.GetInt64(i); break;
                    case "name": Name = reader.GetString(i); break;
                    case "fullname": FullName = reader.GetString(i); break;
                    case "sha1_hash": sha1Hash = reader.GetString(i); break;
                    case "directory_id": DirectoryId = reader.GetInt64(i); break;
                    case "mimetype": Mimetype = reader.GetString(i); break;
                    case "title":
                        Title = DB.IsNull(reader[i]) ? null : reader.GetString(i);
                        break;
                    case "description":
                        Description = DB.IsNull(reader[i]) ? null : reader.GetString(i);
                        break;
                    case "copyright":
                        Copyright = DB.IsNull(reader[i]) ? null : reader.GetString(i);
                        break;
                    case "width": Width = reader.GetInt32(i); break;
                    case "height": Height = reader.GetInt32(i); break;
                    case "size": Size = reader.GetInt64(i); break;
                    case "resolution": Resolution = reader.GetDouble(i); break;
                    case "exif":
                        Exif = DB.IsNull(reader[i]) ? null : reader.GetString(i);
                        break;
                    case "created": Created = reader.GetDateTime(i); break;
                    case "modified":
                        if (!DB.IsNull(reader[i]))
                            Modified = reader.GetDateTime(i);
                        break;
                    case "keywords":
                        Keywords = DB.IsNull(reader[i]) ? null : reader.GetString(i);
                        break;
                }
            }

            if (Id > 0) {
                using (var db = new DbManager(Manager.DbCon)) {
                    var sql = "SELECT * FROM `preview` WHERE [email protected]";
                    if (db.QueryReader(sql, DB.Param("id", Id))) {
                        while (db.DataReader.NextResult()) {
                            db.DataReader.Read();
                            Previews.Add(PreviewFile.FromSql(db.DataReader));
                        }
                    }
                }
            }
        }
开发者ID:poppa,项目名称:MediaDB,代码行数:55,代码来源:MediaFile.cs


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