hi guys i am executing;
select name from sys.Databases
it only shows me system databases like master ect.
but i have lots of databases in my instance
hi guys i am executing;
select name from sys.Databases
it only shows me system databases like master ect.
but i have lots of databases in my instance
Hi @ErdemErdemir-5953 ,
Welcome to Microsoft Q&A!
Here is an article about C# Code: https://hevodata.com/learn/c-sql-server/
Best regards,
Seeya
You may have multiple instances on the same machine.
Double check that you are running this query in your instance correctly.
when i made this program i made users selecting the instance
When i execute this query on ssms there is no problem it shows every database but when i use c# to do it it only shows system databases
When i execute this query on ssms there is no problem it shows every database but when i use c# to do it it only shows system databaseswhen i made this program i made users selecting the instance
yes it has the perm but when i executed in the c# it only says DESKTOP-DESKTOPNAME\CETRUSFORT
this is the code i run
SqlConnection con = new SqlConnection("Server= " + sss.sv + "; Database=; Integrated Security=True;");
con.Open();
SqlCommand cmd = new SqlCommand("SELECT SYSTEM_USER, * FROM sys.fn_my_permissions(NULL, NULL)", con);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
listBox1.Items.Add(dr[0].ToString());
}
con.Close();
yes it has the perm but when i executed in the c# it only says DESKTOP-DESKTOPNAME\CETRUSFORT
And what about @@servername? Is that the same as you see in SSMS?
24 people are following this question.