I installed SQL Server, and here comes Magnament Studio, how do I create my bank? I already tried going there, and I had to authenticate for Windows but it gives an error.
How do I create my bank?
I installed SQL Server, and here comes Magnament Studio, how do I create my bank? I already tried going there, and I had to authenticate for Windows but it gives an error.
How do I create my bank?
There is no secret to connecting, let's look at the simple steps:
1 - In the server name option the name of your local pc, ex Pc-name / user
2 - Brand windows authentication and will connect.
There is no error.
The user must be valid either in SQL Server or even in Windows if you are using delegated authentication for the operating system.
using (var connection = new SqlConnection("data source=NomeDoServidor; uid=usuario; pwd=senha;")) {
using (var cmd = new SqlCommand()) {
connection.Open();
cmd.Connection = connection;
cmd.CommandText = "create database NomeDoBancoDeDados;";
cmd.ExecuteNonQuery();
cmd.CommandText = "use NomeDoBancoDeDados; create table tabela (ID int, campo1 varchar(20));";
cmd.ExecuteNonQuery();
}
}
Of course the creation of the tables is an example, it is not necessary.
Alternative to the string connection: "Server=localhost; Integrated security=SSPI; database=master"
Of course you can, but this should work if you do not have setup and configuration problems in SQL Server. If you have, you need to review this part. Read the documentation before installing. Understand the implications of each choice.