MrTV
asked on
c# mysql get head of table
the code be low how can i get the head of the table
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using System.Web;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string MyConString = "SERVER=localhost;" +
"DATABASE=registration;" +
"UID=root;" +
"PASSWORD='';";
MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand command = connection.CreateCommand();
MySqlDataReader Reader;
command.CommandText = "select * from teera";
connection.Open();
Reader = command.ExecuteReader();
while (Reader.Read())
{
string thisrow = "";
for (int i = 0; i < Reader.FieldCount; i++)
thisrow += Reader.GetValue(i).ToString() + ",";
listBox1.Items.Add(thisrow);
}
connection.Close();
}
}
}
What do you mean by "the head of the table?"
ASKER
Hi kaufmed
I mean column
such as Id Name Address
I mean column
such as Id Name Address
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi kaufmed
I mean column title
I mean column title
>> I mean column title
That's what the code I posted should give you :)
That's what the code I posted should give you :)