About: dbkwik:resource/ztp1HI9EjqU0oZlxE3brzQ==   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

AttributesValues
rdfs:label
  • Guía Práctica MySQL 5.1/Capítulo 10: Programación
rdfs:comment
  • Cargar la lista de géneros: void CargarGeneros(){ string sCmd; sCmd = "SELECT id, nombre " + "FROM genero;"; string sCon = "DSN=videoteca"; OdbcConnection oCon = new OdbcConnection(); oCon.ConnectionString = sCon; oCon.Open(); OdbcCommand oCmd = new OdbcCommand(); oCmd.Connection = oCon; oCmd.CommandText = sCmd; OdbcDataReader oReader; oReader = oCmd.ExecuteReader(); long iId = 0; string sNombre = ""; while(oReader.Read()){ iId = (long)oReader.GetValue(0); sNombre = (string)oReader.GetValue(1); lstGeneros.Items.Add( sNombre + " (" + iId + ")"); } oCon.Close(); lstGeneros.SelectedIndex = 0; } Cargar la lista de soportes: void CargarSoportes(){ string sCmd; sCmd = "SELECT id, nombre " + "FROM soporte;"; string sCon = "DSN=videoteca"; OdbcConnection oCon = new OdbcConnection(); oCon.C
dcterms:subject
abstract
  • Cargar la lista de géneros: void CargarGeneros(){ string sCmd; sCmd = "SELECT id, nombre " + "FROM genero;"; string sCon = "DSN=videoteca"; OdbcConnection oCon = new OdbcConnection(); oCon.ConnectionString = sCon; oCon.Open(); OdbcCommand oCmd = new OdbcCommand(); oCmd.Connection = oCon; oCmd.CommandText = sCmd; OdbcDataReader oReader; oReader = oCmd.ExecuteReader(); long iId = 0; string sNombre = ""; while(oReader.Read()){ iId = (long)oReader.GetValue(0); sNombre = (string)oReader.GetValue(1); lstGeneros.Items.Add( sNombre + " (" + iId + ")"); } oCon.Close(); lstGeneros.SelectedIndex = 0; } Cargar la lista de soportes: void CargarSoportes(){ string sCmd; sCmd = "SELECT id, nombre " + "FROM soporte;"; string sCon = "DSN=videoteca"; OdbcConnection oCon = new OdbcConnection(); oCon.ConnectionString = sCon; oCon.Open(); OdbcCommand oCmd = new OdbcCommand(); oCmd.Connection = oCon; oCmd.CommandText = sCmd; OdbcDataReader oReader; oReader = oCmd.ExecuteReader(); long iId = 0; string sNombre = ""; while(oReader.Read()){ iId = (long)oReader.GetValue(0); sNombre = (string)oReader.GetValue(1); lstSoportes.Items.Add( sNombre + " (" + iId + ")"); } oCon.Close(); lstSoportes.SelectedIndex = 0; } Evento de carga del formulario: void MainFormLoad( object sender, System.EventArgs e) { CargarGeneros(); CargarSoportes(); } Guardar una película: void BtnGuardarClick( object sender, System.EventArgs e) { string sTitulo = txtTitulo.Text; if(sTitulo == ""){ MessageBox.Show( "Indique un título."); return; } int iParentesis = 0; int sLongitud = 0; int sCaracteres = 0; string sGenero = lstGeneros.SelectedItem.ToString(); iParentesis = sGenero.LastIndexOf("(")+1; sLongitud = sGenero.Length; sCaracteres = sLongitud-iParentesis-1; int iIdGenero = 0; iIdGenero = Convert.ToInt16( sGenero.Substring(iParentesis, sCaracteres) ); string sSoporte = lstSoportes.SelectedItem.ToString(); iParentesis = sSoporte.LastIndexOf("(") + 1; sLongitud = sSoporte.Length; sCaracteres = sLongitud - iParentesis - 1; int iIdSoporte = 0; iIdSoporte = Convert.ToInt16( sSoporte.Substring(iParentesis, sCaracteres)); string sConsulta= "INSERT INTO " + "pelicula(titulo, idgenero, idsoporte) " + "VALUES(" + "'" + sTitulo + "', " + iIdGenero + ", " + iIdSoporte + ");"; string sCon = "DSN=videoteca"; OdbcConnection oCon = new OdbcConnection(); oCon.ConnectionString = sCon; oCon.Open(); OdbcCommand oCmd = new OdbcCommand(); oCmd.Connection = oCon; oCmd.CommandText = sConsulta; oCmd.ExecuteNonQuery(); oCon.Close(); }
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software