I am trying to grab data from a MySQL database.
Approach 2 - Application / Map Style
I am using the MySQL ADO Reference to try to create this system. In particular, the example found in 21.2.3.1.7.
(using pseudo code)
let table = build_sequence(query.read)
Where query.read returns a row in a table (or rather, a list of elements that are a row in a table). And a table variable is a list of lists that will represent the table returned from the query.
I stared at the code below and this is the syntax above my head, I'm afraid.
Approach 1 - The Cycle.
Task 1: Inelegant, requiring change.
Problem 2: This is simply wrong, based on my previous experience with Prolog and Lisp. There should be a more ... functional way to do this.
I'm not sure where to start. Comments and thoughts?
let reader : MySql.Data.MySqlClient.MySqlDataReader = command.ExecuteReader() let arr = [] let mutable rowIter = 0 let readingLoop() = while(reader.Read()) do rowIter = rowIter + 1 for i = 0 to reader.FieldCount do
database mysql f #
Paul nathan
source share