Conectarse una base de datos a C#



Conectarse una base de datos a C#

Conectarse una base de datos a C#

Para lograr lo que está en el video debemos:

1) Importar la librería:
using System.Data.SqlClient;

2) Crear una variable global de conexión:

SqlConnection conexion = new SqlConnection(“server=MISERVER\SQLEXPRESS ; database=Mercado ; integrated security = true”);

3) Colocar dentro del botón lo siguiente:
SqlConnection conexion = new SqlConnection(“server=KNOWLEDGEAT3A00\SQLEXPRESS ; database=Mercado ; integrated security = true”);

****************************************

Visita nuestro sitio Web 💻: https://codingraph.com/
Puede descargar mis libros de programación aquí 📚: https://bit.ly/cg-libros

****************************************

Asistente de programación gratuito
––––––––––––––––––––––––––––––
⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I’ve been using Kite for 6 months and I love it! https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=codingraph&utm_content=description-only
––––––––––––––––––––––––––––––