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


C# MySqlDataReader.GetName方法代码示例

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


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

示例1: show

 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 (" ");
     }
 }
开发者ID:Dorowk,项目名称:AD,代码行数:9,代码来源:Program.cs

示例2: Entregador

        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 { }
        }
开发者ID:fmontezuma,项目名称:fmontezuma,代码行数:31,代码来源:Entregador.cs

示例3: Fornecedor

        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 { }
        }
开发者ID:fmontezuma,项目名称:fmontezuma,代码行数:60,代码来源:Fornecedor.cs

示例4: showColumnNames

        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);
             }
            */
        }
开发者ID:jmollaf,项目名称:ad,代码行数:26,代码来源:Program.cs

示例5: 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

示例6: showColumNames

 private static void showColumNames(MySqlDataReader mySqlDataReader)
 {
     for (int i = 0; i < mySqlDataReader.FieldCount; i++) {
         Console.WriteLine ("Columna: " + mySqlDataReader.GetName (i));
     }
     Console.WriteLine (" ");
 }
开发者ID:oscargarciagarcia,项目名称:ad,代码行数:7,代码来源:Program.cs

示例7: debugvar

 public static void debugvar(MySqlDataReader dataReader)
 {
     for (int i = 0; i < dataReader.FieldCount; i++)
     {
         Console.WriteLine("[" + dataReader.GetName(i) + "] = " + dataReader[i]);
     }
     Console.WriteLine("====================================================");
 }
开发者ID:vasialek,项目名称:ajwa,代码行数:8,代码来源:DbHelper.cs

示例8: getColumnNames

 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;
 }
开发者ID:luisso96,项目名称:ad,代码行数:8,代码来源:Program.cs

示例9: showColumnNames

 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+" ");
     }
 }
开发者ID:khadeon,项目名称:AD,代码行数:8,代码来源:Program.cs

示例10: getColumnNames

 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();
 }
开发者ID:JoanJSimpson,项目名称:ad,代码行数:8,代码来源:Program.cs

示例11: getColumnNames2

 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;
 }
开发者ID:ruben206,项目名称:ad,代码行数:8,代码来源:Main.cs

示例12: getColumnNames

 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;
 }
开发者ID:ruben206,项目名称:ad,代码行数:8,代码来源:Main.cs

示例13: showColumnNames

 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;
 }
开发者ID:orgimeno,项目名称:ad,代码行数:8,代码来源:Program.cs

示例14: getcolumNames2

 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;
 }
开发者ID:nerea123,项目名称:ad,代码行数:8,代码来源:Main.cs

示例15: getcolumNames

 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;
 }
开发者ID:nerea123,项目名称:ad,代码行数:9,代码来源:Main.cs


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