Looking for Sample Code for displaying row entries
Posted by: Martijn Damen
Date: December 08, 2004 02:45AM

Hi,

I just started with the mysql .NET API and have managed to create a connection to my database. Now I want to extract some info and display it in a simple winform application, but here I'm getting into trouble.

Sofar I have the following code:

using Mysql.Data.MySqlClient;

...

private void Form1_Load(object sender, System.EventArgs e)
{
string myConnectionString = "Database=damen;Data Source=server User Id=user;Password=pass";
MySqlConnection myConnection = new MySqlConnection(myConnectionString);
string myQuery = "SELECT Tiefe FROM Logbuch WHERE Nr=1";
MySqlCommand myCommand = new MySqlCommand(myQuery);
myCommand.Connection = myConnection;
myConnection.Open();
myCommand.ExecuteReader();
myCommand.Connection.Close();
}

With this I get no errors whatsoever, but how can I get the results of ExecuteReader(); in a form that I can actually use to manipulate or display the data?

Hope one of you guys can post some sample code, thanks in advance!

Enjoy your day!

Cheers, Martijn
www.dusja.net

Options: ReplyQuote


Subject
Written By
Posted
Looking for Sample Code for displaying row entries
December 08, 2004 02:45AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.