Click here to Skip to main content
15,897,315 members
Home / Discussions / C#
   

C#

 
QuestionControl derived from Listbox not drawing properly Pin
Russell Jones28-Jan-10 6:19
Russell Jones28-Jan-10 6:19 
AnswerRe: Control derived from Listbox not drawing properly Pin
Saksida Bojan28-Jan-10 7:54
Saksida Bojan28-Jan-10 7:54 
GeneralRe: Control derived from Listbox not drawing properly Pin
Russell Jones28-Jan-10 8:23
Russell Jones28-Jan-10 8:23 
GeneralRe: Control derived from Listbox not drawing properly Pin
Saksida Bojan28-Jan-10 8:28
Saksida Bojan28-Jan-10 8:28 
QuestionHow to handle Enter key... Pin
mukundkallapur28-Jan-10 5:33
mukundkallapur28-Jan-10 5:33 
AnswerRe: How to handle Enter key... Pin
OriginalGriff28-Jan-10 5:43
mveOriginalGriff28-Jan-10 5:43 
AnswerRe: How to handle Enter key... Pin
Alex Manolescu28-Jan-10 8:16
Alex Manolescu28-Jan-10 8:16 
QuestionGetting info from database in gridview Pin
Bizcrack28-Jan-10 4:03
Bizcrack28-Jan-10 4:03 
Ok, so I have a DataGridView control with 7 columns, the column names are identical to the ones in my MySql Database and I have this code:


C#
public partial class Form3 : Form
   {
       private MySqlConnection connection = new MySqlConnection();
       private MySqlDataAdapter data = new MySqlDataAdapter();

       public Form3()
       {
           InitializeComponent();
           connection.ConnectionString =
           "server=uhhhhh;"
           + "database=uhhhh;"
           + "uid=uhhhh;"
           + "password=uhhh;";
           connection.Open();

           MySqlCommand command = connection.CreateCommand();
           command.CommandText = "select * from data";

           data.SelectCommand = command;
           DataSet dataset = new DataSet();
           data.Fill(dataset, "data");

           gridInfo.DataSource = dataset;
           gridInfo.DataMember = "data";
           gridInfo.Dock = DockStyle.Fill;
       }
   }


Basically what I want to do is retreive all the info from the DataBase, and show it in the DataGridView. I hope you can help me.

Regards,
Melvin
AnswerRe: Getting info from database in gridview Pin
loyal ginger28-Jan-10 4:14
loyal ginger28-Jan-10 4:14 
AnswerRe: Getting info from database in gridview Pin
kevinnicol28-Jan-10 4:42
kevinnicol28-Jan-10 4:42 
GeneralRe: Getting info from database in gridview Pin
OriginalGriff28-Jan-10 5:12
mveOriginalGriff28-Jan-10 5:12 
GeneralRe: Getting info from database in gridview Pin
dan!sh 28-Jan-10 5:48
professional dan!sh 28-Jan-10 5:48 
AnswerRe: Getting info from database in gridview Pin
dan!sh 28-Jan-10 5:46
professional dan!sh 28-Jan-10 5:46 
GeneralRe: Getting info from database in gridview Pin
Bizcrack28-Jan-10 8:51
Bizcrack28-Jan-10 8:51 
AnswerRe: Getting info from database in gridview Pin
Mycroft Holmes28-Jan-10 12:18
professionalMycroft Holmes28-Jan-10 12:18 
AnswerRe: Getting info from database in gridview Pin
yokzie29-Jan-10 20:13
yokzie29-Jan-10 20:13 
Questionaccess database and c# form-adding data Pin
johnnysmith128-Jan-10 2:15
johnnysmith128-Jan-10 2:15 
AnswerRe: access database and c# form-adding data Pin
EliottA28-Jan-10 2:44
EliottA28-Jan-10 2:44 
GeneralRe: access database and c# form-adding data Pin
johnnysmith128-Jan-10 2:57
johnnysmith128-Jan-10 2:57 
QuestionMessage Removed Pin
28-Jan-10 1:08
nercan28-Jan-10 1:08 
AnswerRe: .NET Remoting Customization Made Easy: Custom Sinks Problem Pin
OriginalGriff28-Jan-10 1:35
mveOriginalGriff28-Jan-10 1:35 
QuestionForm issue. Pin
spankyleo12328-Jan-10 0:27
spankyleo12328-Jan-10 0:27 
AnswerRe: Form issue. Pin
OriginalGriff28-Jan-10 0:57
mveOriginalGriff28-Jan-10 0:57 
GeneralRe: Form issue. Pin
spankyleo12328-Jan-10 1:10
spankyleo12328-Jan-10 1:10 
AnswerRe: Form issue. Pin
Syed Shahid Hussain28-Jan-10 1:02
Syed Shahid Hussain28-Jan-10 1:02 

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.