Click here to Skip to main content
15,905,419 members
Home / Discussions / C#
   

C#

 
GeneralRe: email sending program issue Pin
George_George27-Dec-08 1:11
George_George27-Dec-08 1:11 
Questionunicode Pin
VyTrx26-Dec-08 8:33
VyTrx26-Dec-08 8:33 
AnswerRe: unicode Pin
Christian Graus26-Dec-08 12:10
protectorChristian Graus26-Dec-08 12:10 
QuestionBinding data to specific rows Pin
kensai26-Dec-08 7:46
kensai26-Dec-08 7:46 
QuestionCustom Coloumn Headers? [modified] Pin
cobalt-rose26-Dec-08 5:42
cobalt-rose26-Dec-08 5:42 
AnswerRe: Custom Coloumn Headers? Pin
Wendelius26-Dec-08 7:16
mentorWendelius26-Dec-08 7:16 
AnswerRe: Custom Coloumn Headers? Pin
Lev Danielyan26-Dec-08 7:16
Lev Danielyan26-Dec-08 7:16 
GeneralRe: Custom Coloumn Headers? Pin
cobalt-rose27-Dec-08 4:53
cobalt-rose27-Dec-08 4:53 
Thanks for the advice...

I have managed to get my column headers displaying from using an array. But the problem that i now face is that when i click on my "clients" button in my app the data is pulled out but it is only displaying in the first column [see image link]

could you provide me with some tips?

My code:
private void client_buttonBox_Click(object sender, EventArgs e)
{
string[] colhead = { "Client_ID", "Company_Name", "Contact_Name", "Employee_Count" };
int p;

dataCategory = client;

// Create a ColumnHeader object
for (p = 0; p < colhead.Length; p++)
{
ColumnHeader header = new ColumnHeader();

// Set its text to be displayed
header.Text = (colhead[p]);

// Add it to the listview through its columns collection
listView1.Columns.Add(header);
}

string connectionString = "Data Source=localhost" + "; Database=deroche_consultants" + "; User ID=root" + "; Password=password;";
MySqlConnection MySqlConn = new MySqlConnection(connectionString);
string strSQL = ("SELECT company_id, contact_name, company_name, employee_count FROM client");
MySqlCommand mysqlCommand = new MySqlCommand(strSQL, MySqlConn);
MySqlDataReader Reader;
MySqlConn.Open();
Reader = mysqlCommand.ExecuteReader();
while (Reader.Read())
{
string thisrow = "";
for (int i= 0;i<reader.fieldcount;i++)>
thisrow+=Reader.GetValue(i).ToString() + ",";
listView1.Items.Add(thisrow);
}

MySqlConn.Close();
}
http://img.photobucket.com/albums/v678/cozboz/samecolumn.png[^]

[IMG]http://img.photobucket.com/albums/v678/cozboz/samecolumn.png[/IMG]
GeneralRe: Custom Coloumn Headers? Pin
Lev Danielyan27-Dec-08 6:00
Lev Danielyan27-Dec-08 6:00 
GeneralRe: Custom Coloumn Headers? Pin
cobalt-rose30-Dec-08 12:11
cobalt-rose30-Dec-08 12:11 
GeneralRe: Custom Coloumn Headers? Pin
Lev Danielyan30-Dec-08 20:39
Lev Danielyan30-Dec-08 20:39 
QuestionWeb Browser.How to open new window in existent opened browser. Pin
aleXXXka26-Dec-08 4:35
aleXXXka26-Dec-08 4:35 
AnswerRe: Web Browser.How to open new window in existent opened browser. Pin
Aman Bhullar26-Dec-08 5:47
Aman Bhullar26-Dec-08 5:47 
AnswerRe: Web Browser.How to open new window in existent opened browser. Pin
Lev Danielyan26-Dec-08 7:20
Lev Danielyan26-Dec-08 7:20 
GeneralRe: Web Browser.How to open new window in existent opened browser. Pin
aleXXXka27-Dec-08 1:13
aleXXXka27-Dec-08 1:13 
QuestionmenuItem with Shortcut and Icon Pin
mirko8626-Dec-08 4:23
mirko8626-Dec-08 4:23 
GeneralRe: menuItem with Shortcut and Icon Pin
Luc Pattyn26-Dec-08 4:27
sitebuilderLuc Pattyn26-Dec-08 4:27 
GeneralRe: menuItem with Shortcut and Icon Pin
mirko8626-Dec-08 4:30
mirko8626-Dec-08 4:30 
GeneralRe: menuItem with Shortcut and Icon Pin
Luc Pattyn26-Dec-08 4:39
sitebuilderLuc Pattyn26-Dec-08 4:39 
GeneralRe: menuItem with Shortcut and Icon [modified] Pin
mirko8626-Dec-08 4:47
mirko8626-Dec-08 4:47 
GeneralRe: menuItem with Shortcut and Icon Pin
mirko8626-Dec-08 5:45
mirko8626-Dec-08 5:45 
QuestionHow to access a comboBox in dataGridView? Pin
Admin88726-Dec-08 2:25
Admin88726-Dec-08 2:25 
AnswerRe: How to access a comboBox in dataGridView? Pin
Wendelius26-Dec-08 7:26
mentorWendelius26-Dec-08 7:26 
GeneralRe: How to access a comboBox in dataGridView? Pin
Admin88726-Dec-08 21:03
Admin88726-Dec-08 21:03 
GeneralRe: How to access a comboBox in dataGridView? Pin
Wendelius26-Dec-08 22:09
mentorWendelius26-Dec-08 22:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.