Just a quick questions, since most blogs and tutorials I found are about the very basic elements of MySQL and C#.
I am using the MySQL ADO Connector.
I have everything setup and I can retrieve data from the table. But I want to create a method that simplifies things for me. So I can set a query string (either in the method or the object) and call a function and it would return some sort of a data object.
// For each row
while(reader.Read())
{
// For each column
for(int i = 0; i < reader.FieldCount; i++)
{
Console.Write(reader.GetName(i).ToString());
Console.Write(reader.GetValue(i).ToString() + ",");
}
Console.Write("\n");
}
This is what I have now. I could probably just return the reader. But that would require a for loop in a while loop every time I would want to loop through some data.
Wondering if there is a better data object I could fill and return? I would also love links to reading material on this.
BTW I am learning C# so there might be things I'm not 100% clear on.