Salve a tutti...
ho un piccolo problema, mi spiego...
Devo gestire delle news con la possibilità di inserire testo e video ad ongi news aggiunta...
nel salvare i dati non ho problemi, ma mi si è presentato un intoppo nella visualizzazione...
AL momento sto visualizzando il tutto in un datalist e questo funziona perfettamente.
La cosa che a me non piace è che se non è stato caricato alcun video mi rimane il lettore del video senza alcun video.....
sto uscendo pazzo dunque nel provare ad eliminare il lettore se non è stato inserito nessun video....
al momento il codice per visualizzare il datalist è il seguente:
qualcuno ha qualche consiglio???codice:MySqlConnection myConnection = new MySqlConnection("server=localhost; username=root; password=giovanni; database=db;"); myConnection.Open(); MySqlDataAdapter myAdapter = new MySqlDataAdapter("SELECT * FROM eventi ORDER BY creation_evento ASC", myConnection); //Fill the DataSet DataSet ds = new DataSet(); //Get the startRecord Count //Remember database count is zero based so first decrease the value of //the current page int startRecord = (int.Parse(CurrentPage.Value) - 1) * int.Parse(PageSize.Value); //Fetch only the necessary records. myAdapter.Fill(ds, startRecord, int.Parse(PageSize.Value), "Products"); //DataBind the Repeater rptGuestbook.DataSource = ds.Tables["Products"].DefaultView; rptGuestbook.DataBind(); //Second Part //Create a new Command to select the total number of records MySqlCommand myCmd = new MySqlCommand("SELECT Count(*) from eventi", myConnection); //retrieve the value TotalSize.Value = myCmd.ExecuteScalar().ToString(); BuildPagers(); myConnection.Close();
grazie mille


Rispondi quotando