gdata.io.handleScriptLoaded({"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$georss":"http://www.georss.org/georss","xmlns$thr":"http://purl.org/syndication/thread/1.0","xmlns$blogger":"http://schemas.google.com/blogger/2008","id":{"$t":"tag:blogger.com,1999:blog-9172140862204193875"},"updated":{"$t":"2023-12-01T01:34:11.391-06:00"},"category":[{"term":"Windows"},{"term":"Hardware"},{"term":"Base de datos"},{"term":"C Sharp"},{"term":"Descargas"},{"term":"Programación"},{"term":"Windows 7"},{"term":"Cinema 4D"},{"term":"Tutoriales"},{"term":"Teoría"},{"term":"IPod Touch"},{"term":"Arduino"},{"term":"Revisiones"},{"term":"Blogger"},{"term":"Cursos"},{"term":"Windows 8"},{"term":"Curso Aprender a Formatear e instalar Windows"},{"term":"Photoshop"},{"term":"Programas"},{"term":"Videotutoriales"},{"term":"Electrónica"}],"title":{"type":"text","$t":"J E Tutoriales"},"subtitle":{"type":"html","$t":""},"link":[{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"https://www.blogger.com/feeds/9172140862204193875/posts/default/-/Base+de+datos?alt\u003djson-in-script\u0026max-results\u003d50"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/9172140862204193875/posts/default/-/Base+de+datos?alt\u003djson-in-script\u0026max-results\u003d50"},{"rel":"alternate","type":"text/html","href":"http://www.tutorialesje.com/search/label/Base%20de%20datos"},{"rel":"hub","href":"http://pubsubhubbub.appspot.com/"}],"author":[{"name":{"$t":"Jeovani Martinez"},"uri":{"$t":"https://www.blogger.com/profile/06991244172484822798"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"32","height":"32","src":"//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs7BwcUJ8SHvIPEBaEx6nhIpCBwTgwHNlWS5ojiPZvHF1qNRxAi5gBCH8YKPdIRp7fjym9vpjZ70kTyxGysy13AXcIOC3bmPEjJGuft6taCCeVr7eZ7vSOlr57jjabyQ/s126/Nueva+imagen.jpg"}}],"generator":{"version":"7.00","uri":"https://www.blogger.com","$t":"Blogger"},"openSearch$totalResults":{"$t":"1"},"openSearch$startIndex":{"$t":"1"},"openSearch$itemsPerPage":{"$t":"50"},"entry":[{"id":{"$t":"tag:blogger.com,1999:blog-9172140862204193875.post-7154913398895431177"},"published":{"$t":"2017-04-24T18:57:00.002-05:00"},"updated":{"$t":"2017-04-24T18:58:48.641-05:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"C Sharp"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Programación"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Base de datos"}],"title":{"type":"text","$t":"Inicio de Sesión (Login) con C Sharp y SQL Server"},"content":{"type":"html","$t":"\u003cdiv class\u003d\"separator\" style\u003d\"clear: both; text-align: center;\"\u003e\n\u003ca href\u003d\"https://2.bp.blogspot.com/-qM6X64bHvcE/WP6BJaGciGI/AAAAAAAAA1o/JIxqxAuFQCo7KDLb6gi0tOzaAsQpbWk3gCLcB/s1600/Imagen.png\" imageanchor\u003d\"1\" style\u003d\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"\u003e\u003cimg border\u003d\"0\" height\u003d\"360\" src\u003d\"https://2.bp.blogspot.com/-qM6X64bHvcE/WP6BJaGciGI/AAAAAAAAA1o/JIxqxAuFQCo7KDLb6gi0tOzaAsQpbWk3gCLcB/s640/Imagen.png\" width\u003d\"640\" /\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cspan style\u003d\"text-align: justify;\"\u003eUn tutorial sobre cómo desarrollar una aplicación en Visual Studio con el lenguaje de programación C Sharp que permita iniciar sesión e identificar al tipo de usuario en una base de datos, utilizando el sistema de bases de datos Microsoft SQL Server.\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"text-align: justify;\"\u003e\u003cbr /\u003e\u003c/span\u003e\n\u003cbr /\u003e\n\u003cdiv class\u003d\"separator\" style\u003d\"clear: both; text-align: center;\"\u003e\n\u003ciframe allowfullscreen\u003d\"\" class\u003d\"YOUTUBE-iframe-video\" data-thumbnail-src\u003d\"https://i.ytimg.com/vi/TrWxfcp4UgI/0.jpg\" frameborder\u003d\"0\" height\u003d\"360\" src\u003d\"https://www.youtube.com/embed/TrWxfcp4UgI?feature\u003dplayer_embedded\" width\u003d\"640\"\u003e\u003c/iframe\u003e\u003c/div\u003e\n\u003cbr /\u003e\n\u003cdiv class\u003d\"MsoNormal\" style\u003d\"text-align: center;\"\u003e\n\u003cb\u003e\u003cspan style\u003d\"font-size: large;\"\u003eCódigo Fuente\u0026nbsp;\u003c/span\u003e\u003c/b\u003e\u003cbr /\u003e\n\u003cb\u003e\u003cspan style\u003d\"font-size: large;\"\u003e\u003cbr /\u003e\n\u003c/span\u003e\u003c/b\u003e \u003cb\u003e\u003cspan style\u003d\"font-size: large;\"\u003eScript Base de Datos\u003c/span\u003e\u003c/b\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;\"\u003e\n\u003ctable\u003e\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cpre style\u003d\"line-height: 125%; margin: 0;\"\u003e1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n10\n11\n12\n13\n14\n15\n16\n17\u003c/pre\u003e\n\u003c/td\u003e\u003ctd\u003e\u003cpre style\u003d\"line-height: 125%; margin: 0;\"\u003eUSE master\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eCREATE\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eDATABASE\u003c/span\u003e escuela\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eGO\u003c/span\u003e\nUSE escuela\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eCREATE\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eTABLE\u003c/span\u003e usuario\n(\nnombreUsuario nvarchar(\u003cspan style\u003d\"color: #0000dd; font-weight: bold;\"\u003e20\u003c/span\u003e) \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003ePRIMARY\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eKEY\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enot\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enull\u003c/span\u003e,\ncontrasena nvarchar(\u003cspan style\u003d\"color: #0000dd; font-weight: bold;\"\u003e20\u003c/span\u003e) \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enot\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enull\u003c/span\u003e,\nnombre nvarchar(\u003cspan style\u003d\"color: #0000dd; font-weight: bold;\"\u003e50\u003c/span\u003e) \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enot\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enull\u003c/span\u003e,\napellidoPaterno nvarchar(\u003cspan style\u003d\"color: #0000dd; font-weight: bold;\"\u003e50\u003c/span\u003e) \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enot\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enull\u003c/span\u003e,\napellidoMaterno nvarchar(\u003cspan style\u003d\"color: #0000dd; font-weight: bold;\"\u003e50\u003c/span\u003e),\ntipoUsuario nvarchar(\u003cspan style\u003d\"color: #0000dd; font-weight: bold;\"\u003e20\u003c/span\u003e) \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enot\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enull\u003c/span\u003e\n)\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eGO\u003c/span\u003e\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eINSERT\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eINTO\u003c/span\u003e usuario \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eVALUES\u003c/span\u003e(\u003cspan style\u003d\"background-color: #fff0f0;\"\u003e'jesus'\u003c/span\u003e, \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e'123A'\u003c/span\u003e, \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e'Jesús'\u003c/span\u003e, \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e'Morales'\u003c/span\u003e, \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e'Campos'\u003c/span\u003e, \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e'Administrador'\u003c/span\u003e)\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eINSERT\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eINTO\u003c/span\u003e usuario \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eVALUES\u003c/span\u003e(\u003cspan style\u003d\"background-color: #fff0f0;\"\u003e'roberto'\u003c/span\u003e, \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e'123456'\u003c/span\u003e, \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e'Roberto'\u003c/span\u003e, \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e'Castro'\u003c/span\u003e, \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e'Morales'\u003c/span\u003e, \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e'Profesor'\u003c/span\u003e)\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eGO\u003c/span\u003e\n\u003c/pre\u003e\n\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\u003c/table\u003e\n\u003c/div\u003e\n\u003cdiv class\u003d\"MsoNormal\" style\u003d\"text-align: center;\"\u003e\n\u003cb\u003e\u003cspan style\u003d\"font-size: large;\"\u003e\u003cbr /\u003e\n\u003c/span\u003e\u003c/b\u003e \u003cb\u003e\u003cspan style\u003d\"font-size: large;\"\u003eClase BaseDatos.cs\u003c/span\u003e\u003c/b\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;\"\u003e\n\u003ctable\u003e\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cpre style\u003d\"line-height: 125%; margin: 0;\"\u003e1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\u003c/pre\u003e\n\u003c/td\u003e\u003ctd\u003e\u003cpre style\u003d\"line-height: 125%; margin: 0;\"\u003e\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Collections.Generic\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Linq\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Text\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Threading.Tasks\u003c/span\u003e;\n\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Data.SqlClient\u003c/span\u003e;\n\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enamespace\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eInicioSesion\u003c/span\u003e\n{\n    \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eclass\u003c/span\u003e \u003cspan style\u003d\"color: #bb0066; font-weight: bold;\"\u003eBaseDatos\u003c/span\u003e\n    {\n        \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eprivate\u003c/span\u003e \u003cspan style\u003d\"color: #333399; font-weight: bold;\"\u003estring\u003c/span\u003e cadenaConexion \u003d \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\"Data Source\u003dJEOVANI-PC; Initial Catalog\u003descuela; Integrated Security\u003dtrue;\"\u003c/span\u003e;\n\n        \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003epublic\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003estatic\u003c/span\u003e \u003cspan style\u003d\"color: #333399; font-weight: bold;\"\u003estring\u003c/span\u003e nombreCompleto \u003d \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\"\"\u003c/span\u003e;\n        \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003epublic\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003estatic\u003c/span\u003e \u003cspan style\u003d\"color: #333399; font-weight: bold;\"\u003estring\u003c/span\u003e tipoUsuario \u003d \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\"\"\u003c/span\u003e;\n\n        \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003epublic\u003c/span\u003e Boolean \u003cspan style\u003d\"color: #0066bb; font-weight: bold;\"\u003einiciarSesion\u003c/span\u003e(\u003cspan style\u003d\"color: #333399; font-weight: bold;\"\u003estring\u003c/span\u003e nomus, \u003cspan style\u003d\"color: #333399; font-weight: bold;\"\u003estring\u003c/span\u003e con)\n        {\n            nombreCompleto \u003d \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\"\"\u003c/span\u003e;\n            tipoUsuario \u003d \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\"\"\u003c/span\u003e;\n\n            SqlConnection conexion \u003d \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enew\u003c/span\u003e SqlConnection(cadenaConexion);\n            conexion.Open();\n\n            SqlParameter parnomus \u003d \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enew\u003c/span\u003e SqlParameter(\u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\"@nomus\"\u003c/span\u003e, nomus);\n            SqlParameter parcon \u003d \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enew\u003c/span\u003e SqlParameter(\u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\"@con\"\u003c/span\u003e, con);\n\n            SqlCommand comando \u003d \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enew\u003c/span\u003e SqlCommand(\u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\"SELECT nombre, apellidoPaterno, apellidoMaterno, tipoUsuario FROM usuario WHERE nombreUsuario \u003d @nomus AND contrasena COLLATE Latin1_General_CS_AS \u003d @con\"\u003c/span\u003e, conexion);\n            comando.Parameters.Add(parnomus);\n            comando.Parameters.Add(parcon);\n\n            SqlDataReader lector \u003d comando.ExecuteReader();\n            \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003ewhile\u003c/span\u003e (lector.Read())\n            {\n                nombreCompleto \u003d lector.GetString(\u003cspan style\u003d\"color: #6600ee; font-weight: bold;\"\u003e0\u003c/span\u003e) + \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\" \"\u003c/span\u003e + lector.GetString(\u003cspan style\u003d\"color: #6600ee; font-weight: bold;\"\u003e1\u003c/span\u003e) + \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\" \"\u003c/span\u003e + lector.GetString(\u003cspan style\u003d\"color: #6600ee; font-weight: bold;\"\u003e2\u003c/span\u003e);\n                tipoUsuario \u003d lector.GetString(\u003cspan style\u003d\"color: #6600ee; font-weight: bold;\"\u003e3\u003c/span\u003e);\n            }\n\n            lector.Close();\n            conexion.Close();\n\n            \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eif\u003c/span\u003e (String.IsNullOrEmpty(tipoUsuario))\n            {\n                \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003ereturn\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003efalse\u003c/span\u003e;\n            }\n            \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eelse\u003c/span\u003e\n            {\n                \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003ereturn\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003etrue\u003c/span\u003e;\n            }\n        }\n    }\n}\n\u003c/pre\u003e\n\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\u003c/table\u003e\n\u003c/div\u003e\n\u003cdiv class\u003d\"MsoNormal\" style\u003d\"text-align: center;\"\u003e\n\u003cb\u003e\u003cspan style\u003d\"font-size: large;\"\u003e\u003cbr /\u003e\n\u003c/span\u003e\u003c/b\u003e \u003cb\u003e\u003cspan style\u003d\"font-size: large;\"\u003eForm1.cs\u003c/span\u003e\u003c/b\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;\"\u003e\n\u003ctable\u003e\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cpre style\u003d\"line-height: 125%; margin: 0;\"\u003e1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\u003c/pre\u003e\n\u003c/td\u003e\u003ctd\u003e\u003cpre style\u003d\"line-height: 125%; margin: 0;\"\u003e\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Collections.Generic\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.ComponentModel\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Data\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Drawing\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Linq\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Text\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Threading.Tasks\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Windows.Forms\u003c/span\u003e;\n\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enamespace\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eInicioSesion\u003c/span\u003e\n{\n    \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003epublic\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003epartial\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eclass\u003c/span\u003e \u003cspan style\u003d\"color: #bb0066; font-weight: bold;\"\u003eForm1\u003c/span\u003e : Form\n    {\n        \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003epublic\u003c/span\u003e \u003cspan style\u003d\"color: #0066bb; font-weight: bold;\"\u003eForm1\u003c/span\u003e()\n        {\n            InitializeComponent();\n        }\n\n        \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eprivate\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003evoid\u003c/span\u003e \u003cspan style\u003d\"color: #0066bb; font-weight: bold;\"\u003ebtiniciarsesion_Click\u003c/span\u003e(\u003cspan style\u003d\"color: #333399; font-weight: bold;\"\u003eobject\u003c/span\u003e sender, EventArgs e)\n        {\n            \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eif\u003c/span\u003e (!String.IsNullOrEmpty(tbnombreusuario.Text) \u0026amp;\u0026amp; !String.IsNullOrEmpty(tbcontrasena.Text))\n            {\n                \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003etry\u003c/span\u003e\n                {\n                    BaseDatos bd \u003d \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enew\u003c/span\u003e BaseDatos();\n\n                    Boolean res \u003d bd.iniciarSesion(tbnombreusuario.Text, tbcontrasena.Text);\n\n                    \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eif\u003c/span\u003e (res)\n                    {\n                        Principal p \u003d \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enew\u003c/span\u003e Principal();\n                        p.Show();\n                        \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003ethis\u003c/span\u003e.Hide();\n                    }\n                    \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eelse\u003c/span\u003e\n                    {\n                        MessageBox.Show(\u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\"Datos Incorrectos\"\u003c/span\u003e);\n                    }\n                }\n                \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003ecatch\u003c/span\u003e\n                {\n                    MessageBox.Show(\u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\"Error\"\u003c/span\u003e);\n                }\n            }\n            \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eelse\u003c/span\u003e\n            {\n                MessageBox.Show(\u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\"Complete los datos\"\u003c/span\u003e);\n            }\n        }\n    }\n}\n\u003c/pre\u003e\n\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\u003c/table\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\u003cdiv class\u003d\"MsoNormal\" style\u003d\"text-align: center;\"\u003e\n\u003cb\u003e\u003cspan style\u003d\"font-size: large;\"\u003ePrincipal.cs\u003c/span\u003e\u003c/b\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;\"\u003e\n\u003ctable\u003e\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cpre style\u003d\"line-height: 125%; margin: 0;\"\u003e1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\u003c/pre\u003e\n\u003c/td\u003e\u003ctd\u003e\u003cpre style\u003d\"line-height: 125%; margin: 0;\"\u003e\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Collections.Generic\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.ComponentModel\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Data\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Drawing\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Linq\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Text\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Threading.Tasks\u003c/span\u003e;\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eusing\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eSystem.Windows.Forms\u003c/span\u003e;\n\n\u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003enamespace\u003c/span\u003e \u003cspan style\u003d\"color: #0e84b5; font-weight: bold;\"\u003eInicioSesion\u003c/span\u003e\n{\n    \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003epublic\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003epartial\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eclass\u003c/span\u003e \u003cspan style\u003d\"color: #bb0066; font-weight: bold;\"\u003ePrincipal\u003c/span\u003e : Form\n    {\n        \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003epublic\u003c/span\u003e \u003cspan style\u003d\"color: #0066bb; font-weight: bold;\"\u003ePrincipal\u003c/span\u003e()\n        {\n            InitializeComponent();\n\n            labelusuario.Text \u003d BaseDatos.nombreCompleto;\n\n            \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eif\u003c/span\u003e (BaseDatos.tipoUsuario \u003d\u003d \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\"Administrador\"\u003c/span\u003e)\n            {\n                paneladministrador.Visible \u003d \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003etrue\u003c/span\u003e;\n                panelprofesor.Visible \u003d \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003efalse\u003c/span\u003e;\n\n            }\n            \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eelse\u003c/span\u003e \u003cspan style\u003d\"color: #0066bb; font-weight: bold;\"\u003eif\u003c/span\u003e (BaseDatos.tipoUsuario \u003d\u003d \u003cspan style\u003d\"background-color: #fff0f0;\"\u003e\"Profesor\"\u003c/span\u003e)\n            {\n                paneladministrador.Visible \u003d \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003efalse\u003c/span\u003e;\n                panelprofesor.Visible \u003d \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003etrue\u003c/span\u003e;\n            }\n\n        }\n\n        \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003eprivate\u003c/span\u003e \u003cspan style\u003d\"color: #008800; font-weight: bold;\"\u003evoid\u003c/span\u003e \u003cspan style\u003d\"color: #0066bb; font-weight: bold;\"\u003ePrincipal_FormClosed\u003c/span\u003e(\u003cspan style\u003d\"color: #333399; font-weight: bold;\"\u003eobject\u003c/span\u003e sender, FormClosedEventArgs e)\n        {\n            Application.Exit();\n        }\n    }\n}\n\u003c/pre\u003e\n\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\u003c/table\u003e\n\u003c/div\u003e\n\u003cbr /\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.tutorialesje.com/feeds/7154913398895431177/comments/default","title":"Enviar comentarios"},{"rel":"replies","type":"text/html","href":"https://www.tutorialesje.com/2017/04/inicio-de-sesion-login-con-c-y-sql.html#comment-form","title":"1 comentarios"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/9172140862204193875/posts/default/7154913398895431177"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/9172140862204193875/posts/default/7154913398895431177"},{"rel":"alternate","type":"text/html","href":"https://www.tutorialesje.com/2017/04/inicio-de-sesion-login-con-c-y-sql.html","title":"Inicio de Sesión (Login) con C Sharp y SQL Server"}],"author":[{"name":{"$t":"Jeovani Martinez"},"uri":{"$t":"https://www.blogger.com/profile/06991244172484822798"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"32","height":"32","src":"//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs7BwcUJ8SHvIPEBaEx6nhIpCBwTgwHNlWS5ojiPZvHF1qNRxAi5gBCH8YKPdIRp7fjym9vpjZ70kTyxGysy13AXcIOC3bmPEjJGuft6taCCeVr7eZ7vSOlr57jjabyQ/s126/Nueva+imagen.jpg"}}],"media$thumbnail":{"xmlns$media":"http://search.yahoo.com/mrss/","url":"https://2.bp.blogspot.com/-qM6X64bHvcE/WP6BJaGciGI/AAAAAAAAA1o/JIxqxAuFQCo7KDLb6gi0tOzaAsQpbWk3gCLcB/s72-c/Imagen.png","height":"72","width":"72"},"thr$total":{"$t":"1"}}]}});