GetName() public méthode

Gets the name of the specified column.
public GetName ( int i ) : String
i int
Résultat String
Exemple #1
0
 private static void show(MySqlDataReader reader)
 {
     while (reader.Read()){
         for (int i =0; i< reader.FieldCount; i++) {
             Console.Write ("{0} = {1} ", reader.GetName (i), reader [reader.GetName (i)]);
         }
         Console.WriteLine (" ");
     }
 }
Exemple #2
0
        public Entregador(MySqlDataReader rs)
        {
            try
            {
                int i = 0;
                while (true)
                {
                    switch (rs.GetName(i))
                    {
                        case "cpf":
                            this.cpf = rs.GetString(i);
                            break;
                        case "nome":
                            this.nome = rs.GetString(i);
                            break;
                        case "telefone":
                            if (this.telefone == null) this.telefone = new model.Telefone();
                            this.telefone.Numero = rs.GetString(i);
                            break;
                        case "placa":
                            this.placa = rs.GetString(i);
                            break;
                        default:
                            throw new Exception("Propriedade não encontrada");
                    }

                    i++;
                }
            }
            catch { }
        }
Exemple #3
0
        public Fornecedor(MySqlDataReader rs)
        {
            try
            {
                int i = 0;
                while (true)
                {
                    switch (rs.GetName(i))
                    {
                        case "cnpj":
                            this.cnpj = rs.GetString(i);
                            break;
                        case "nome":
                            this.nome = rs.GetString(i);
                            break;
                        case "endereco_rua":
                            if (this.endereco == null) this.endereco = new model.Endereco();
                            this.endereco.Rua = rs.GetString(i);
                            break;
                        case "endereco_numero":
                            if (this.endereco == null) this.endereco = new model.Endereco();
                            this.endereco.Numero = rs.GetString(i);
                            break;
                        case "endereco_complemento":
                            if (this.endereco == null) this.endereco = new model.Endereco();
                            this.endereco.Complemento = rs.GetString(i);
                            break;
                        case "endereco_bairro":
                            if (this.endereco == null) this.endereco = new model.Endereco();
                            this.endereco.Bairro = rs.GetString(i);
                            break;
                        case "endereco_cep":
                            if (this.endereco == null) this.endereco = new model.Endereco();
                            this.endereco.Cep = rs.GetString(i);
                            break;
                        case "endereco_cidade":
                            if (this.endereco == null) this.endereco = new model.Endereco();
                            this.endereco.Cidade = rs.GetString(i);
                            break;
                        case "endereco_estado":
                            if (this.endereco == null) this.endereco = new model.Endereco();
                            this.endereco.Estado = rs.GetString(i);
                            break;
                        case "telefone_ddd":
                            if (this.telefone == null) this.telefone = new model.Telefone();
                            this.telefone.Ddd = rs.GetString(i);
                            break;
                        case "telefone_tel":
                            if (this.telefone == null) this.telefone = new model.Telefone();
                            this.telefone.Numero = rs.GetString(i);
                            break;
                        default:
                            throw new Exception("Propriedade não encontrada");
                    }

                    i++;
                }
            }
            catch { }
        }
Exemple #4
0
        private static void showColumnNames(MySqlDataReader mySqlDataReader)
        {
            //SOLUCION MIA
            int numeroColumnas = mySqlDataReader.FieldCount;
            for (int i=0;i<numeroColumnas;i++)
                {
                  Console.Write (mySqlDataReader.GetName(i) + " ");
                }

            /*SOLUCION PROFESOR 1
            Console.WriteLine ("showColumnNames...");
            for (int index = 0; index < mySqlDataReader.FieldCount; index++) {
                Console.WriteLine ("index=" + index + " columna=" + mySqlDataReader.GetName (index));
            }
            */
            /*SOLUCION PROFESOR 2 CON ARRAY
             int count= mySqlDataReader.FieldCount;
             string[] columNames = new string[count];
             for(int index =0; index <count; index++){
                 columNames [index] = mySqlDataReader.GetName (index);
             }
             foreach (string columnName in columnNames){
                 console.WriteLine ("Columna=" +columnName);
             }
            */
        }
Exemple #5
0
        private static void showColumNames(MySqlDataReader mysqlDataReader)
        {
            // SOLUCION YO
            int columns = mysqlDataReader.FieldCount;
            //Console.Write (columns);

            for (int i=0; i < columns; i++) {
                Console.Write (mysqlDataReader.GetName(i)+"        ");
            }

            //			// OTRA OPCION
            //			int count = mysqlDataReader.FieldCount;  //cuenta  las columnas
            //			List<string> columnNames = new List<string> ();  //crea una lista
            //			for (int i=0; i< count; i++) {    //la recorre
            //				columnNames.Add (mysqlDataReader.GetName (i));
            return columnNames.ToArray ();
            //			}

            //			/* SOLUCION PROFESOR
            //			int columns = mysqlDataReader.FieldCount;
            //			String [] columnNames = new string[columns];
            //			for (int i=0; i<columns;i++){
            //				columnNames [i] = mysqlDataReader.GetName (i);
            //		}*/
        }
Exemple #6
0
		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;
		}
Exemple #7
0
 private static void showColumNames(MySqlDataReader mySqlDataReader)
 {
     for (int i = 0; i < mySqlDataReader.FieldCount; i++) {
         Console.WriteLine ("Columna: " + mySqlDataReader.GetName (i));
     }
     Console.WriteLine (" ");
 }
Exemple #8
0
 public static void debugvar(MySqlDataReader dataReader)
 {
     for (int i = 0; i < dataReader.FieldCount; i++)
     {
         Console.WriteLine("[" + dataReader.GetName(i) + "] = " + dataReader[i]);
     }
     Console.WriteLine("====================================================");
 }
Exemple #9
0
 private static string[] getColumnNames(MySqlDataReader mySqlDataReader)
 {
     int count = mySqlDataReader.FieldCount;
     string[] columnNames = new string[count];
     for (int i = 0; i < count; i++)
         columnNames [i] = mySqlDataReader.GetName (i);
     return columnNames;
 }
Exemple #10
0
 public static string[] getColumnNames(MySqlDataReader mySqlDataReader)
 {
     int count = mySqlDataReader.FieldCount;
     List<string> columnNames = new List<string> ();
     for (int index = 0; index < count; index++)
         columnNames.Add (mySqlDataReader.GetName (index));
     return columnNames.ToArray();
 }
Exemple #11
0
 private static string[] showColumnNames(MySqlDataReader mysqldatareader)
 {
     int columns = mysqldatareader.FieldCount;
     string[] columnasNombre = new string[columns];
     for (int i=columns-1; i>=0; i--)
         columnasNombre[i] = mysqldatareader.GetName (i);
     return columnasNombre;
 }
Exemple #12
0
 private static IEnumerable<string> getcolumNames2(MySqlDataReader mysqlDataReader)
 {
     int numCol=mysqlDataReader.FieldCount;
     List<string> columNames= new List<string>();
     for(int i=0;i<numCol;i++)
         columNames.Add(mysqlDataReader.GetName(i));
     return columNames;
 }
Exemple #13
0
 private static IEnumerable<string> getColumnNames(MySqlDataReader mySqlDataReader)
 {
     int fieldCount = mySqlDataReader.FieldCount;
     string[] columnNames = new string[ fieldCount ];
     for (int index = 0; index < fieldCount; index++)
         columnNames[index] = mySqlDataReader.GetName (index);
     return columnNames;
 }
Exemple #14
0
 private static IEnumerable<string> getColumnNames2(MySqlDataReader mySqlDataReader)
 {
     int fieldCount = mySqlDataReader.FieldCount;
     List<string> columnNames = new List<string>();
     for (int index = 0; index < fieldCount; index++)
         columnNames.Add ( mySqlDataReader.GetName(index) );
     return columnNames;
 }
Exemple #15
0
 private static void showColumnNames(MySqlDataReader mySqlDataReader)
 {
     String columnName = "";
     for (int i=0; i<mySqlDataReader.FieldCount; i++) {
         columnName = mySqlDataReader.GetName (i);
         Console.WriteLine ("posicion "+i+ " = "+columnName+" ");
     }
 }
        public DBRowDescriptor(ref MySqlDataReader res)
        {
            int column = res.FieldCount;

            for (int i = 0; i < column; i++)
            {
                AddColumn(res.GetName(i), this.GetType(i, ref res));
            }
        }
Exemple #17
0
 private static IEnumerable<string> getcolumNames(MySqlDataReader mysqlDataReader)
 {
     string[] names=new string [mysqlDataReader.FieldCount];
     int numCol=mysqlDataReader.FieldCount;
     for(int i=0;i<numCol;i++){
         names[i]=mysqlDataReader.GetName(i);
     }
     return names;
 }
Exemple #18
0
 private static void showColumnNames(MySqlDataReader mySqlDataReader)
 {
     Console.WriteLine ("Columnas:");
     for (int i = 0; i < mySqlDataReader.FieldCount; i++)
     {
         Console.WriteLine("nº = " + i + " // nombre: " + mySqlDataReader.GetName (i));
     }
     Console.WriteLine ("");
 }
Exemple #19
0
        //-----------------------------------------------------------------------------------------------------------
        private static string[] getColumns(MySqlDataReader mysqldatareader)
        {
            int count = mysqldatareader.FieldCount;
            List<string> columNames = new List<string> ();
            for (int i =0; i<count; i++) {
                columNames.Add (mysqldatareader.GetName(i));

            }
            return columNames.ToArray ();
        }
Exemple #20
0
        public static void showColumNames(MySqlDataReader mySqlDataReader)
        {
            // METODO QUE MUESTRA NUMERO Y NOMBRE DE LAS COLUMNAS
            Console.WriteLine ("COLUMNAS :");

            //string[] columNames = getColumNames (mySqlDataReader);
            //Console.WriteLine (string.Join(",",columNames));								// ES LO MISMO QUE EL FOR DE ABAJO

            for (int i=0; i < mySqlDataReader.FieldCount; i++)
                Console.WriteLine ("num columa= " + i + ", nombre= " + mySqlDataReader.GetName (i));
        }
Exemple #21
0
        private static string[] getColumNames(MySqlDataReader mySqlDataReader)
        {
            string[] names = new string[mySqlDataReader.FieldCount];
            int numColum = mySqlDataReader.FieldCount;

            //Obtencion de las cabeceras
            for (int i = 0; i<numColum; i++){
                names[i]=mySqlDataReader.GetName(i);
            }
            return names;
        }
Exemple #22
0
        //-----------------------SQL BUTTONS------------------------------------------------------------------------------------

        private void button1_Click(object sender, EventArgs e)
        {
            flag = 0;
            establishConnection();
            if (flag == 1)
            {
                textBox8.Text  = "Invalid SQL Connection";
                textBox8.Text += System.Environment.NewLine + "Try Again!";
            }
            else
            {
                //textBox8.Text = "Valid SQL Connection";
                string stringInput = textBox2.Text;

                if (stringInput == "")
                {
                    textBox8.Clear();
                    textBox8.Text = "Error Invalid Input. Try Again!";
                    return;
                }

                int input = Int32.Parse(stringInput);

                try
                {
                    int nid = input;

                    string query = String.Format(@"
                            SELECT title
                            FROM news
                            WHERE news_id = {0};", nid);

                    MySql.Data.MySqlClient.MySqlCommand    cmd    = new MySqlCommand(query, conn);
                    MySql.Data.MySqlClient.MySqlDataReader reader = cmd.ExecuteReader();

                    textBox8.Clear();

                    textBox8.AppendText(String.Format("{0}", reader.GetName(0)));
                    textBox8.Text += System.Environment.NewLine;

                    while (reader.Read())
                    {
                        //Console.WriteLine(reader[0]);
                        textBox8.Text += reader[0];
                        textBox8.Text += System.Environment.NewLine;
                    }
                    reader.Close();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                }
            }
        }
Exemple #23
0
 private static void showColumnNames(MySqlDataReader mySqlDataReader)
 {
     Console.Write ("======================================================");
     Console.WriteLine ();
     for (int index = 0; index < mySqlDataReader.FieldCount; index++){
         Console.Write ("   " + mySqlDataReader.GetName(index) + "     ");
     }
     Console.WriteLine ();
     Console.Write ("======================================================");
     Console.WriteLine ();
 }
Exemple #24
0
        public static void showColumnNames(MySqlDataReader mySqlDataReader)
        {
            int numeroColumnas = mySqlDataReader.FieldCount;
            string nombreColumnas = null;
            for (int i=0; i < numeroColumnas; i++) {

                nombreColumnas += "Columna "+i+" :"+ mySqlDataReader.GetName (i)+ " ";

            }

            Console.WriteLine (nombreColumnas);
        }
Exemple #25
0
        //-----------------------------------------------------------------------------------------------------------
        private static void showColumnNames(MySqlDataReader mysqldatareader)
        {
            String columnName="";
            String[] array = new String[mysqldatareader.FieldCount];

            for (int i=0; i<mysqldatareader.FieldCount; i++) {

                columnName = mysqldatareader.GetName(i);
                array [i] = columnName;

                Console.WriteLine (columnName+" ");

            }
        }
Exemple #26
0
        public static string[] getColumnNames(MySqlDataReader mySqlDataReader)
        {
            //			int count = mySqlDataReader.FieldCount;
            //			string[] columnNames = new string[count];
            //			for (int index = 0; index < count; index++)
            //				columnNames [index] = mySqlDataReader.GetName (index);
            //			return columnNames;

            int count = mySqlDataReader.FieldCount;
            List<string> columNames = new List<string> ();
            for (int index = 0; index < count; index++)
                columNames.Add (mySqlDataReader.GetName (index));
            return columNames.ToArray ();
        }
Exemple #27
0
        public static string[] getColumNames(MySqlDataReader mySqlDataReader)
        {
            // METODO QUE DEVUELVE UNA LISTA CON LA LINEA DE LA TABLA. (PUEDE HACERSE DEVOLVIENDO UN STRING)
            int count = mySqlDataReader.FieldCount;
            //string[] columNames = new string[count];
            //for(int i=0;i<count;i++){
            //	ColumNames[i]=mySqlDataReader.GetName (i)}
            //return columNames

            List<string> columNames = new List<string> ();
            for(int i =0;i<count;i++)
                columNames.Add (mySqlDataReader.GetName(i));
            return columNames.ToArray();													//PARA PASARLO A ARRAY USAR EL METODO .TOARRAY()
        }
Exemple #28
0
        public static void show(MySqlDataReader mySqlDataReader)
        {
            int numeroRegistro = mySqlDataReader.VisibleFieldCount;
            Console.WriteLine ("");
            int numeroColumnas = mySqlDataReader.FieldCount;
            string fila = null;
            for (int i=0; i <= numeroRegistro; i++) {
                mySqlDataReader.Read ();
                for (int j=0; j< numeroColumnas; j++) {

                    fila += mySqlDataReader.GetName (j)+": " +mySqlDataReader.GetValue (j).ToString () + " ";

                }
                Console.WriteLine (fila);
                fila = null;
            }
        }
Exemple #29
0
		private System.Data.DataTable ConvertToDataTable(MySqlDataReader Reader)
		{
			int index = 0;
			string ColumnName;

			System.Data.DataTable dt = new System.Data.DataTable();

			while(Reader.Read())
			{
				ColumnName = Reader.GetName(index);
				
				dt.Columns.Add(ColumnName);     
//				dt.
				
				index++;
			}

			return dt;
		}
Exemple #30
0
        private void Form2_Load(object sender, EventArgs e)
        {
            myDReader = myCmd.ExecuteReader();
            string[] arr = new string[100];
            for (int i = 0; i < myDReader.FieldCount; i++)
            {
                dataGridView1.Columns.Add(i.ToString(), myDReader.GetName(i));
            }

            while (myDReader.Read())
            {
                for (int i = 0; i < myDReader.FieldCount; i++)
                {
                    arr[i] = myDReader.GetString(i);
                }
                dataGridView1.Rows.Add(arr);
            }
            myDReader.Close();
        }
Exemple #31
0
 /**
  * 将MySqlDataReader对象读取为二维数组
  * */
 public List <Dictionary <string, object> > GetResult(MySqlDataReader mySqlDataReader)
 {
     if (connection.State == ConnectionState.Closed)
     {
         return(null);
     }
     if (mySqlDataReader != null)
     {
         //判断列数
         List <Dictionary <string, object> > result = new List <Dictionary <string, object> >();
         try
         {
             while (mySqlDataReader.Read())
             {
                 Dictionary <string, object> tempRow = new Dictionary <string, object>();
                 for (int i = 0; i < mySqlDataReader.FieldCount; i++)
                 {
                     var    val = mySqlDataReader.GetValue(i);
                     string str;
                     if (val.GetType() == typeof(DateTime))
                     {
                         str = ((DateTime)val).ToString("yyyy-MM-dd HH-mm-ss");
                     }
                     else
                     {
                         str = val.ToString();
                     }
                     tempRow.Add(mySqlDataReader.GetName(i), val);
                 }
                 result.Add(tempRow);
             }
         }
         catch (MySqlException e)
         {
             throw e;
         }
         mySqlDataReader.Close();
         IntegratedResult = result;
         return(result);
     }
     IntegratedResult = null;
     return(null);
 }
        internal void ProcessOutputParameters(MySqlDataReader reader)
        {
            this.AdjustOutputTypes(reader);
            if ((reader.CommandBehavior & CommandBehavior.SchemaOnly) != CommandBehavior.Default)
            {
                return;
            }
            reader.Read();
            string text = "@_cnet_param_";

            for (int i = 0; i < reader.FieldCount; i++)
            {
                string text2 = reader.GetName(i);
                if (text2.StartsWith(text, StringComparison.OrdinalIgnoreCase))
                {
                    text2 = text2.Remove(0, text.Length);
                }
                this.command.Parameters.GetParameterFlexible(text2, true).Value = reader.GetValue(i);
            }
        }
Exemple #33
0
        private MySqlDataReader GetHackedOuputParameters()
        {
            if (outSelect.Length == 0)
            {
                return(null);
            }

            MySqlCommand cmd = new MySqlCommand("SELECT " + outSelect, Connection);

            MySqlDataReader reader = cmd.ExecuteReader();
            // since MySQL likes to return user variables as strings
            // we reset the types of the readers internal value objects
            // this will allow those value objects to parse the string based
            // return values
            ResultSet results = reader.ResultSet;

            for (int i = 0; i < reader.FieldCount; i++)
            {
                string fieldName = reader.GetName(i);
                fieldName = fieldName.Remove(0, ParameterPrefix.Length + 1);
                MySqlParameter parameter = Parameters.GetParameterFlexible(fieldName, true);

                IMySqlValue v = MySqlField.GetIMySqlValue(parameter.MySqlDbType);
                if (v is MySqlBit)
                {
                    MySqlBit bit = (MySqlBit)v;
                    bit.ReadAsString = true;
                    results.SetValueObject(i, bit);
                }
                else
                {
                    results.SetValueObject(i, v);
                }
            }
            if (!reader.Read())
            {
                reader.Close();
                return(null);
            }
            return(reader);
        }
Exemple #34
0
        public void WriteToFile(string Filename, MySqlDataReader dr)
        {
            Filename = @"C:\Reportes\" + Filename;
            using (System.IO.StreamWriter fs = new System.IO.StreamWriter(Filename))
            {
                // Loop through the fields and add headers
                for (int i = 0; i < dr.FieldCount; i++)
                {
                    string name = dr.GetName(i);
                    if (name.Contains(","))
                        name = "\"" + name + "\"";

                    if (i != dr.FieldCount - 1)
                        fs.Write(name + ",");
                    else
                        fs.Write(name);
                }
                fs.WriteLine();

                // Loop through the rows and output the data
                while (dr.Read())
                {
                    for (int i = 0; i < dr.FieldCount; i++)
                    {
                        string value = dr[i].ToString();
                        if (value.Contains(","))
                            value = "\"" + value + "\"";

                        if (i != dr.FieldCount - 1)
                            fs.Write(value + ",");
                        else
                            fs.Write(value);

                    }
                    fs.WriteLine();
                }

                fs.Close();
                fs.Dispose();
            }
        }
Exemple #35
0
        private static string Export_GetInsertStatementHeader(RowsDataExportMode rowsExportMode, string tableName,
                                                              MySqlDataReader rdr)
        {
            if (rdr == null)
            {
                throw new ArgumentNullException(nameof(rdr));
            }
            var sb = new StringBuilder();

            switch (rowsExportMode)
            {
            case RowsDataExportMode.Insert:
                sb.Append("INSERT INTO `");
                break;

            case RowsDataExportMode.InsertIgnore:
                sb.Append("INSERT IGNORE INTO `");
                break;

            case RowsDataExportMode.Replace:
                sb.Append("REPLACE INTO `");
                break;
            }

            sb.Append(tableName);
            sb.Append("`(");

            for (var i = 0; i < rdr.FieldCount; i++)
            {
                if (i > 0)
                {
                    sb.Append(",");
                }
                sb.Append("`");
                sb.Append(rdr.GetName(i));
                sb.Append("`");
            }

            sb.Append(") VALUES");
            return(sb.ToString());
        }
    private MySqlSchemaCollection GetTable(string sql)
    {
      MySqlSchemaCollection c = new MySqlSchemaCollection();
      MySqlCommand cmd = new MySqlCommand(sql, connection);
      MySqlDataReader reader = cmd.ExecuteReader();

      // add columns
      for (int i = 0; i < reader.FieldCount; i++)
        c.AddColumn(reader.GetName(i), reader.GetFieldType(i));

      using (reader)
      {
        while (reader.Read())
        {
          MySqlSchemaRow row = c.AddRow();
          for (int i = 0; i < reader.FieldCount; i++)
            row[i] = reader.GetValue(i);
        }
      }
      return c;
    }
 private void AdjustOutputTypes(MySqlDataReader reader)
 {
     for (int i = 0; i < reader.FieldCount; i++)
     {
         string text = reader.GetName(i);
         if (text.IndexOf("_cnet_param_") != -1)
         {
             text = text.Remove(0, "_cnet_param_".Length + 1);
         }
         IMySqlValue iMySqlValue = MySqlField.GetIMySqlValue(this.command.Parameters.GetParameterFlexible(text, true).MySqlDbType);
         if (iMySqlValue is MySqlBit)
         {
             MySqlBit mySqlBit = (MySqlBit)iMySqlValue;
             mySqlBit.ReadAsString = true;
             reader.ResultSet.SetValueObject(i, mySqlBit);
         }
         else
         {
             reader.ResultSet.SetValueObject(i, iMySqlValue);
         }
     }
 }
        private MySqlSchemaCollection GetTable(string sql)
        {
            MySqlSchemaCollection mySqlSchemaCollection = new MySqlSchemaCollection();
            MySqlCommand          mySqlCommand          = new MySqlCommand(sql, this.connection);
            MySqlDataReader       mySqlDataReader       = mySqlCommand.ExecuteReader();

            for (int i = 0; i < mySqlDataReader.FieldCount; i++)
            {
                mySqlSchemaCollection.AddColumn(mySqlDataReader.GetName(i), mySqlDataReader.GetFieldType(i));
            }
            using (mySqlDataReader)
            {
                while (mySqlDataReader.Read())
                {
                    MySqlSchemaRow mySqlSchemaRow = mySqlSchemaCollection.AddRow();
                    for (int j = 0; j < mySqlDataReader.FieldCount; j++)
                    {
                        mySqlSchemaRow[j] = mySqlDataReader.GetValue(j);
                    }
                }
            }
            return(mySqlSchemaCollection);
        }
Exemple #39
0
        protected MySqlSchemaCollection QueryCollection(string name, string sql)
        {
            MySqlSchemaCollection c      = new MySqlSchemaCollection(name);
            MySqlCommand          cmd    = new MySqlCommand(sql, connection);
            MySqlDataReader       reader = cmd.ExecuteReader();

            for (int i = 0; i < reader.FieldCount; i++)
            {
                c.AddColumn(reader.GetName(i), reader.GetFieldType(i));
            }

            using (reader)
            {
                while (reader.Read())
                {
                    MySqlSchemaRow row = c.AddRow();
                    for (int i = 0; i < reader.FieldCount; i++)
                    {
                        row[i] = reader.GetValue(i);
                    }
                }
            }
            return(c);
        }