Hi,
I've an asp.net web application that shows, through an odbc connection to a
mysql database, the content of the table chosen from a DropDownList.

The code go well on windows but on linux with mono 1.01 not all the tables are
shown correctly.

Could anybody help me?

web application : WebForm1VisuaTabelle.aspx, WebForm1.VisuaTabelle.aspx.cs
dump db mysql : tdmio.txt


thanks,

Valentina.
# MySQL-Front Dump 2.5
#
# Host: localhost   Database: tdmio
# --------------------------------------------------------
# Server version 4.1.3b-beta-nt


#
# Table structure for table 'gruppi'
#

DROP TABLE IF EXISTS `gruppi`;
CREATE TABLE `gruppi` (
  `CodiceGruppo` varchar(4) NOT NULL default '0',
  `Nome` varchar(15) default 'Null',
  `Descrizione` varchar(25) default 'Null',
  PRIMARY KEY  (`CodiceGruppo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



#
# Dumping data for table 'gruppi'
#

INSERT INTO `gruppi` (`CodiceGruppo`, `Nome`, `Descrizione`) VALUES("G1", 
"Pianificatori", "Utenti Pianificatori");
INSERT INTO `gruppi` (`CodiceGruppo`, `Nome`, `Descrizione`) VALUES("G2", "Altri", 
"Altri utenti");
INSERT INTO `gruppi` (`CodiceGruppo`, `Nome`, `Descrizione`) VALUES("G3", 
"Amministrativi", "Addetti Amministrazione");


#
# Table structure for table 'ordini'
#

DROP TABLE IF EXISTS `ordini`;
CREATE TABLE `ordini` (
  `Problema` char(4) NOT NULL default '0',
  `CodiceOrdine` int(4) NOT NULL default '0',
  `CurSessione` int(4) default '0',
  `Data` date default NULL,
  PRIMARY KEY  (`CodiceOrdine`,`Problema`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



#
# Dumping data for table 'ordini'
#

INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"1", "0", "0000-00-00");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"2", "0", "0000-00-00");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"3", "11", "0000-00-00");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"4", "11", "2004-07-29");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"5", "11", "2004-07-31");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"6", "10", "2004-08-05");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"7", "10", "2004-07-28");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"8", "0", "2004-07-29");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"9", "0", "2004-08-05");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"10", "0", "2004-08-05");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"11", "0", "2004-07-30");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"12", "0", "2004-08-10");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"13", "0", "2004-08-14");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"14", "0", "2004-08-16");
INSERT INTO `ordini` (`Problema`, `CodiceOrdine`, `CurSessione`, `Data`) VALUES("1", 
"15", "0", "2004-08-07");


#
# Table structure for table 'problemi'
#

DROP TABLE IF EXISTS `problemi`;
CREATE TABLE `problemi` (
  `CodiceProblema` varchar(4) NOT NULL default '0',
  `Nome` varchar(10) default 'Null',
  `Data` date default NULL,
  PRIMARY KEY  (`CodiceProblema`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



#
# Dumping data for table 'problemi'
#

INSERT INTO `problemi` (`CodiceProblema`, `Nome`, `Data`) VALUES("1", "Problema1", 
"2004-08-17");
INSERT INTO `problemi` (`CodiceProblema`, `Nome`, `Data`) VALUES("2", "Problema2", 
"2004-08-09");
INSERT INTO `problemi` (`CodiceProblema`, `Nome`, `Data`) VALUES("3", "Problema3", 
"2004-08-07");
INSERT INTO `problemi` (`CodiceProblema`, `Nome`, `Data`) VALUES("4", "Problema4", 
"2004-08-08");
INSERT INTO `problemi` (`CodiceProblema`, `Nome`, `Data`) VALUES("5", "Problema5", 
"2004-08-10");


#
# Table structure for table 'sequenze'
#

DROP TABLE IF EXISTS `sequenze`;
CREATE TABLE `sequenze` (
  `CodiceViaggio` int(5) NOT NULL default '0',
  `Problema` char(4) NOT NULL default '0',
  `Sequenza` char(4) NOT NULL default 'Null',
  `ProblemaOrdine` char(4) default '0',
  `CodiceOrdine` char(4) NOT NULL default 'Nul',
  PRIMARY KEY  (`CodiceViaggio`,`Problema`,`Sequenza`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



#
# Dumping data for table 'sequenze'
#

INSERT INTO `sequenze` (`CodiceViaggio`, `Problema`, `Sequenza`, `ProblemaOrdine`, 
`CodiceOrdine`) VALUES("1", "1", "Null", "0", "7");
INSERT INTO `sequenze` (`CodiceViaggio`, `Problema`, `Sequenza`, `ProblemaOrdine`, 
`CodiceOrdine`) VALUES("3", "1", "Null", "0", "6");
INSERT INTO `sequenze` (`CodiceViaggio`, `Problema`, `Sequenza`, `ProblemaOrdine`, 
`CodiceOrdine`) VALUES("4", "1", "Null", "0", "3");
INSERT INTO `sequenze` (`CodiceViaggio`, `Problema`, `Sequenza`, `ProblemaOrdine`, 
`CodiceOrdine`) VALUES("5", "1", "Null", "0", "1");
INSERT INTO `sequenze` (`CodiceViaggio`, `Problema`, `Sequenza`, `ProblemaOrdine`, 
`CodiceOrdine`) VALUES("6", "1", "Null", "0", "2");
INSERT INTO `sequenze` (`CodiceViaggio`, `Problema`, `Sequenza`, `ProblemaOrdine`, 
`CodiceOrdine`) VALUES("7", "1", "Null", "0", "5");
INSERT INTO `sequenze` (`CodiceViaggio`, `Problema`, `Sequenza`, `ProblemaOrdine`, 
`CodiceOrdine`) VALUES("8", "1", "Null", "0", "5");
INSERT INTO `sequenze` (`CodiceViaggio`, `Problema`, `Sequenza`, `ProblemaOrdine`, 
`CodiceOrdine`) VALUES("9", "1", "Null", "0", "5");
INSERT INTO `sequenze` (`CodiceViaggio`, `Problema`, `Sequenza`, `ProblemaOrdine`, 
`CodiceOrdine`) VALUES("10", "1", "Null", "0", "4");
INSERT INTO `sequenze` (`CodiceViaggio`, `Problema`, `Sequenza`, `ProblemaOrdine`, 
`CodiceOrdine`) VALUES("11", "1", "Null", "0", "4");
INSERT INTO `sequenze` (`CodiceViaggio`, `Problema`, `Sequenza`, `ProblemaOrdine`, 
`CodiceOrdine`) VALUES("12", "1", "Null", "0", "4");


#
# Table structure for table 'sessione'
#

DROP TABLE IF EXISTS `sessione`;
CREATE TABLE `sessione` (
  `CodiceSessione` int(4) NOT NULL default '0',
  `Problema` varchar(4) NOT NULL default '0',
  `Stato` varchar(10) default 'Null',
  `Nome` varchar(10) default 'Null',
  `Utente` varchar(4) NOT NULL default 'Nul',
  PRIMARY KEY  (`CodiceSessione`,`Problema`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



#
# Dumping data for table 'sessione'
#

INSERT INTO `sessione` (`CodiceSessione`, `Problema`, `Stato`, `Nome`, `Utente`) 
VALUES("1", "1", "chiusa", "Null", "U1");
INSERT INTO `sessione` (`CodiceSessione`, `Problema`, `Stato`, `Nome`, `Utente`) 
VALUES("2", "1", "chiusa", "Null", "U1");
INSERT INTO `sessione` (`CodiceSessione`, `Problema`, `Stato`, `Nome`, `Utente`) 
VALUES("3", "1", "chiusa", "Null", "U1");
INSERT INTO `sessione` (`CodiceSessione`, `Problema`, `Stato`, `Nome`, `Utente`) 
VALUES("4", "1", "chiusa", "Null", "U4");
INSERT INTO `sessione` (`CodiceSessione`, `Problema`, `Stato`, `Nome`, `Utente`) 
VALUES("5", "1", "chiusa", "Null", "U1");
INSERT INTO `sessione` (`CodiceSessione`, `Problema`, `Stato`, `Nome`, `Utente`) 
VALUES("6", "1", "chiusa", "Null", "U4");
INSERT INTO `sessione` (`CodiceSessione`, `Problema`, `Stato`, `Nome`, `Utente`) 
VALUES("7", "1", "chiusa", "Null", "U5");
INSERT INTO `sessione` (`CodiceSessione`, `Problema`, `Stato`, `Nome`, `Utente`) 
VALUES("8", "1", "chiusa", "Null", "U4");
INSERT INTO `sessione` (`CodiceSessione`, `Problema`, `Stato`, `Nome`, `Utente`) 
VALUES("9", "1", "chiusa", "Null", "U1");
INSERT INTO `sessione` (`CodiceSessione`, `Problema`, `Stato`, `Nome`, `Utente`) 
VALUES("10", "1", "chiusa", "Null", "U1");
INSERT INTO `sessione` (`CodiceSessione`, `Problema`, `Stato`, `Nome`, `Utente`) 
VALUES("11", "1", "chiusa", "Null", "U1");


#
# Table structure for table 'utenti'
#

DROP TABLE IF EXISTS `utenti`;
CREATE TABLE `utenti` (
  `CodiceUtente` varchar(4) NOT NULL default '0',
  `UserID` varchar(10) NOT NULL default 'Null',
  `Password` varchar(10) NOT NULL default '0',
  `Gruppo` varchar(4) NOT NULL default 'Nul',
  `Nome` varchar(10) default 'Null',
  `Cognome` varchar(15) default 'Null',
  `Descrizione` varchar(20) default 'Null',
  PRIMARY KEY  (`CodiceUtente`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



#
# Dumping data for table 'utenti'
#

INSERT INTO `utenti` (`CodiceUtente`, `UserID`, `Password`, `Gruppo`, `Nome`, 
`Cognome`, `Descrizione`) VALUES("U1", "id1", "pwd1", "G1", "utente1", "Null", "Null");
INSERT INTO `utenti` (`CodiceUtente`, `UserID`, `Password`, `Gruppo`, `Nome`, 
`Cognome`, `Descrizione`) VALUES("U2", "id2", "pwd2", "G2", "utente2", "Null", "Null");
INSERT INTO `utenti` (`CodiceUtente`, `UserID`, `Password`, `Gruppo`, `Nome`, 
`Cognome`, `Descrizione`) VALUES("U3", "id3", "pwd3", "G0", "utente3", "Null", "Null");
INSERT INTO `utenti` (`CodiceUtente`, `UserID`, `Password`, `Gruppo`, `Nome`, 
`Cognome`, `Descrizione`) VALUES("U4", "id4", "pwd4", "G1", "utente4", "Null", "Null");
INSERT INTO `utenti` (`CodiceUtente`, `UserID`, `Password`, `Gruppo`, `Nome`, 
`Cognome`, `Descrizione`) VALUES("U5", "id5", "pwd5", "G1", "utente5", "Null", "Null");


#
# Table structure for table 'veicoli'
#

DROP TABLE IF EXISTS `veicoli`;
CREATE TABLE `veicoli` (
  `CodiceVeicolo` varchar(4) NOT NULL default 'Nul',
  `Descrizione` varchar(15) default 'Null',
  `Cliente` varchar(10) default 'Null',
  `Disponibile` varchar(4) default 'Nul',
  PRIMARY KEY  (`CodiceVeicolo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



#
# Dumping data for table 'veicoli'
#

INSERT INTO `veicoli` (`CodiceVeicolo`, `Descrizione`, `Cliente`, `Disponibile`) 
VALUES("V1", "VeicoloUno", "Null", "no");
INSERT INTO `veicoli` (`CodiceVeicolo`, `Descrizione`, `Cliente`, `Disponibile`) 
VALUES("V10", "VeicoloDieci", "Null", "si");
INSERT INTO `veicoli` (`CodiceVeicolo`, `Descrizione`, `Cliente`, `Disponibile`) 
VALUES("V2", "VeicoloDue", "Null", "no");
INSERT INTO `veicoli` (`CodiceVeicolo`, `Descrizione`, `Cliente`, `Disponibile`) 
VALUES("V3", "VeicoloTre", "Null", "no");
INSERT INTO `veicoli` (`CodiceVeicolo`, `Descrizione`, `Cliente`, `Disponibile`) 
VALUES("V4", "VeicoloQuattro", "Null", "no");
INSERT INTO `veicoli` (`CodiceVeicolo`, `Descrizione`, `Cliente`, `Disponibile`) 
VALUES("V5", "VeicoloCinque", "Null", "no");
INSERT INTO `veicoli` (`CodiceVeicolo`, `Descrizione`, `Cliente`, `Disponibile`) 
VALUES("V6", "VeicoloSei", "Null", "si");
INSERT INTO `veicoli` (`CodiceVeicolo`, `Descrizione`, `Cliente`, `Disponibile`) 
VALUES("V7", "VeicoloSette", "Null", "si");
INSERT INTO `veicoli` (`CodiceVeicolo`, `Descrizione`, `Cliente`, `Disponibile`) 
VALUES("V8", "VeicoloOtto", "Null", "si");
INSERT INTO `veicoli` (`CodiceVeicolo`, `Descrizione`, `Cliente`, `Disponibile`) 
VALUES("V9", "VeicoloNove", "Null", "si");


#
# Table structure for table 'viaggi'
#

DROP TABLE IF EXISTS `viaggi`;
CREATE TABLE `viaggi` (
  `CodiceViaggio` int(5) NOT NULL default '0',
  `Problema` varchar(4) NOT NULL default '0',
  `CurSessione` varchar(4) default 'Nul',
  `Data` date default NULL,
  `Veicolo` varchar(4) default 'Nul',
  `Autista` varchar(20) default 'Null',
  PRIMARY KEY  (`Problema`,`CodiceViaggio`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



#
# Dumping data for table 'viaggi'
#

INSERT INTO `viaggi` (`CodiceViaggio`, `Problema`, `CurSessione`, `Data`, `Veicolo`, 
`Autista`) VALUES("1", "1", "8", NULL, "V1", "Null");
INSERT INTO `viaggi` (`CodiceViaggio`, `Problema`, `CurSessione`, `Data`, `Veicolo`, 
`Autista`) VALUES("3", "1", "8", NULL, "V3", "Null");
INSERT INTO `viaggi` (`CodiceViaggio`, `Problema`, `CurSessione`, `Data`, `Veicolo`, 
`Autista`) VALUES("4", "1", "9", NULL, "V6", "Null");
INSERT INTO `viaggi` (`CodiceViaggio`, `Problema`, `CurSessione`, `Data`, `Veicolo`, 
`Autista`) VALUES("5", "1", "9", NULL, "V7", "Null");
INSERT INTO `viaggi` (`CodiceViaggio`, `Problema`, `CurSessione`, `Data`, `Veicolo`, 
`Autista`) VALUES("6", "1", "9", NULL, "V8", "Null");
INSERT INTO `viaggi` (`CodiceViaggio`, `Problema`, `CurSessione`, `Data`, `Veicolo`, 
`Autista`) VALUES("7", "1", "10", NULL, "V1", "Null");
INSERT INTO `viaggi` (`CodiceViaggio`, `Problema`, `CurSessione`, `Data`, `Veicolo`, 
`Autista`) VALUES("8", "1", "10", NULL, "V2", "Null");
INSERT INTO `viaggi` (`CodiceViaggio`, `Problema`, `CurSessione`, `Data`, `Veicolo`, 
`Autista`) VALUES("9", "1", "10", NULL, "V5", "Null");
INSERT INTO `viaggi` (`CodiceViaggio`, `Problema`, `CurSessione`, `Data`, `Veicolo`, 
`Autista`) VALUES("10", "1", "11", NULL, "V2", "Null");
INSERT INTO `viaggi` (`CodiceViaggio`, `Problema`, `CurSessione`, `Data`, `Veicolo`, 
`Autista`) VALUES("11", "1", "11", NULL, "V3", "Null");
INSERT INTO `viaggi` (`CodiceViaggio`, `Problema`, `CurSessione`, `Data`, `Veicolo`, 
`Autista`) VALUES("12", "1", "11", NULL, "V4", "Null");

Attachment: WebForm1VisuaTabelle.aspx
Description: Binary data

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.Odbc;

namespace VisuaTabelle
{
	/// <summary>
	/// Summary description for WebForm1.
	/// </summary>
	public class WebForm1 : System.Web.UI.Page
	{
		private void Page_Load(object sender, System.EventArgs e)
		{
			// Put user code to initialize the page here
			Tabella = DropDownList1.SelectedItem.Text;
		}

		protected System.Web.UI.WebControls.Button ButtonRicerca;
		protected System.Web.UI.WebControls.DataGrid DataGrid1;
		protected System.Web.UI.WebControls.Label Label1;
		protected System.Web.UI.WebControls.Label Label2;
		protected System.Web.UI.WebControls.DropDownList DropDownList1;
		protected System.Web.UI.WebControls.Button Button1;

		string Tabella = null;
		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
			this.ButtonRicerca.Click += new System.EventHandler(this.ButtonRicerca_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void ButtonRicerca_Click(object sender, System.EventArgs e)
		{
			Label2.Text = "Tabella "+ Tabella;
			//OdbcConnection conn = new OdbcConnection("DRIVER={MySQL ODBC 3.51 Driver};"+"SERVER=localhost;"+"DATABASE=tdmio;"+"UID=root;"+"PASSWORD=rootpwd;");
			OdbcConnection conn = new OdbcConnection ("DRIVER=MySQL;SERVER=localhost;DATABASE=tdmio;UID=root;PASSWORD=rootpwd;");
			OdbcDataAdapter daTabella = new OdbcDataAdapter("select * from " +Tabella + "", conn);
			DataSet Ds = new DataSet();
			conn.Open();
			daTabella.Fill(Ds, Tabella);
			conn.Close();
			DataGrid1.DataSource= Ds;
			DataGrid1.DataBind();
		}
	}
}

Reply via email to