dir.by  
  Search  
Programming, development, testing
ADO.NET (working with the database on C#)
Database connection string | ADO.NET, C#
  Looked at 4945 times    
 Database connection string | ADO.NET, C# 
last updated: 22 July 2025
To make a connection string, do the following:
In Visual Studio click ToolsConnect to Database... in the menu
In the "Add Connection" window, select
Server name:
Select the computer where the server is located for the database.
The server for the database is the program SQl Server
1) can be selected from the list [v]
2) You can write local, which means we will use SQL Server on your computer (locally).
Select or enter a database name:
Choose a database name
1) can be selected from the list [v]
Click Test Connection to see if there is a connection to the database (i.e. if we have specified server name and database name correctly)
Press the "Advanced..." button
Let's copy the text:
  C#     In the C# code, we will use it to connect to the database
string connectionString = @"Data Source=localhost;Initial Catalog=MyDatabase1;Integrated Security=True;Trust Server Certificate=True";
 
← Previous topic
Read the image from the database and save it to a file | ADO.NET, C#
 
 
Your feedback ... Comments ...
   
Your Name
Your comment (www links can only be added by a logged-in user)

  Объявления  
  Объявления  
 
What is ADO.NET?
Let's create a ADO.NET console application (C#, database)
Working with data in ADO.NET
Read the data (select) from the Database using SqlCommand and SqlDataReader in ADO.NET C#. Database Type Mapping
Read (select) data from the Database using SqlDataAdapter and DataSet | ADO.NET, C#
Get a scalar (single) value: Count, Min, Max, Sum, etc. | ADO.NET, C#
Add data (insert into) to the Database using SqlCommand | ADO.NET, C#
Change the data (update) in the Database using SqlCommand | ADO.NET, C#
Delete data in the Database using SqlCommand | ADO.NET, C#
Stored procedures in ADO.NET
Stored procedures in ADO.NET | C#
Transactions in ADO.NET
Transactions in ADO.NET | Database in the C# console application
Reading the picture from the database ADO.NET
Read the image from the database and save it to a file | ADO.NET, C#
Additional topics, questions
Database connection string | ADO.NET, C#

  Ваши вопросы присылайте по почте: info@dir.by  
Яндекс.Метрика