Proper way to make a connection and query to a SQL Server Express database
问题 I need a sample C# (console application) code witch connects to an SQL Server Express database and inserts a few variables into a table "laptops" SQL Server Express is @ localhost user name is database and password is testdatabase What is the proper way to do that ? 回答1: Basic ADO.NET 101: set up a connection set up a command to do something execute that command Step 1: setting up a connection You need to know the connection string to your database. Check out http://www.connectionstrings.com