How to make changes in Visual Studio 2019 form GUI and see the changes in SQL Server Management Studio
//1. Address of SQL SERVER and Database
String ConnectionString = "Data Source=your database server name; Initial Catalog= db to which you want to connect; Integrated Security =True";
//2. Establish the connection
//2.a Import the using System.data.SqlClient
//2.b Create a new Object
SqlConnection conn = new SqlConnection(ConnectionString);
//3. Open Connection
conn.Open();
//4. Prepare Query
String FirstName = textBox1.Text;
String LastName = textBox2.Text;
string Query = "INSERT INTO Names (FirstName,LastName) VALUES ('"+FirstName+ "','"+LastName+"')";
//5. Execute Query
SqlCommand cmd = new SqlCommand(Query, conn);
cmd.ExecuteNonQuery();
//6. Finally Close the Connection
conn.Close();
MessageBox.Show("Data is successfully saved in Database");
To checkout other assisting videos:
SQL SERVER INSTALLATION:
• SQL SERVER INSTALLATION Steps # Downlo...
SQLServer Management Studio INSTALLATION:
• SQL SERVER MANAGEMENT STUDIO - BASICS #C...
TO import Database tables in SQLServer Management Studio using mdf or sql file
• To import Database tables using SQL file o...
How to connect SSMS and VS:
• How to connect Visual Studio 2019 and SQL ...