[Mono-devel-list] DataAdapter retrieves only two records

Jorge De Gante jdegante at linuxware.com.mx
Thu Feb 12 15:20:54 EST 2004


Hello Everybody

With Mono 0.29 this method returns all records in query. But with
version 0.30 only returns two records no matter what query executes.
I'm workin with MySQL and, I've checked the query in the mysql shell an
runs OK.

public DataTable CreateDataTable(string in_columns, string in_relation,
string in_condicion, string in_orden)
{
try
{
	string sql;
	if (in_columns == "")
	{
		in_columns = "*";
	}
	if (in_relation == "")
	{
		in_relation = table_name;
	}
	sql = "SELECT " + in_columns;
	sql += " FROM " + in_relation; 
	if (in_condicion != "")
	sql += " WHERE " + in_condicion;
	if (in_orden != "")     
	sql += " ORDER BY " + in_orden;
	Console.WriteLine("sql del CreateDataAdapter = " + sql);
	DataSet dataset = new DataSet(table_name);
	IDbDataAdapter dataadapter = Globals.CreateDataAdapter(sql);
	dataadapter.FillSchema(dataset, SchemaType.Mapped);
	dataadapter.Fill(dataset);
	return dataset.Tables[0];
}
catch (Exception ex)
{
	Console.WriteLine("Error al crear el DataTable: \n" + ex.Message);
	throw ex;
}
}

There is a bug in dataadapter or in dataset?

Please check it out.




More information about the Mono-devel-list mailing list