I have an ASP.NET MVC 3 test website running on Mono v2.10.2 on Ubuntu v10.04. I am using MySQL Connector / NET as a database provider.
On the test page, a simple query of choice is made to the MySQL server using the WebMatrix.Data class. When I execute the code, I get the correct number of rows returned, but it repeats the same data from one of the rows, instead of showing the correct separate data for each row.
I get the following:
username5
username5
username5
username5
username5
But I should get the following:
username1
username2
username3
username4
username5
, - Windows ( , Mono), . MySQL Ubuntu, .
:
var db = Database.OpenConnectionString("server=localhost;database=MyDb;Uid=xxx;Pwd=xxx", "MySql.Data.MySqlClient");
ViewBag.Pools = db.Query("select * from MyTable");
:
@foreach(var p in ViewBag.Pools)
{
<div>@p.username</div>
}
- , WebMatrix.Data?