bin01ary
bin01ary
CC#
Created by Alex on 10/31/2023 in #help
✅ SQLConnection and queries to the database
$close
33 replies
CC#
Created by Alex on 10/31/2023 in #help
✅ SQLConnection and queries to the database
then you can SELECT * FROM Alunos if you are connected to the Escola database
33 replies
CC#
Created by Alex on 10/31/2023 in #help
✅ SQLConnection and queries to the database
you can just do Alunos if you are running the create statement in the Escola database
33 replies
CC#
Created by Alex on 10/31/2023 in #help
✅ SQLConnection and queries to the database
is Escola your database name?
33 replies
CC#
Created by Alex on 10/31/2023 in #help
✅ SQLConnection and queries to the database
it happens to all of us
33 replies
CC#
Created by Alex on 10/31/2023 in #help
✅ SQLConnection and queries to the database
yep. Escola.Alunos is now your table name.
33 replies
CC#
Created by Alex on 10/31/2023 in #help
✅ SQLConnection and queries to the database
assuming you have variables for server and database
33 replies
CC#
Created by Alex on 10/31/2023 in #help
✅ SQLConnection and queries to the database
String conn = $"Server={server};Database={database};Trusted_Connection=True;";
String conn = $"Server={server};Database={database};Trusted_Connection=True;";
33 replies
CC#
Created by Alex on 10/31/2023 in #help
✅ SQLConnection and queries to the database
The other thing I can suggest is change the first line
String conn = $@"Server={server};Database={database};Trusted_Connection=True;";
String conn = $@"Server={server};Database={database};Trusted_Connection=True;";
so you just use $ instead of $@
33 replies
CC#
Created by Alex on 10/31/2023 in #help
✅ SQLConnection and queries to the database
I was referring to when they mentioned dbo.[{database}.Alunos]
33 replies
CC#
Created by Alex on 10/31/2023 in #help
✅ SQLConnection and queries to the database
I'm guessing something is wrong with the way your database is setup.
33 replies
CC#
Created by Alex on 10/31/2023 in #help
✅ SQLConnection and queries to the database
When you do a select statement, normally it would be [{database}].[dbo].[Alunos] not dbo.[{database}.Alunos]. Your database name should come before the schema name (dbo).
33 replies