I need some help...I have my app MKS
Create database MKS_2017 and using...work fine
Now I create MKS_2018 and using working fine
I need when login in my app to using (username,password) and in combox to chose database data to show in my app (MKS_2017 or MKS_2018)
I read database from server on this way:
- public List<string> GetDatabaseList()
- {
- List<string> list = new List<string>();
-
- using (SqlConnection con = new SqlConnection(cs))
- {
- con.Open();
-
-
-
- using (SqlCommand cmd = new SqlCommand("SELECT name from sys.databases where name like 'MKS%'", con))
- {
- using (IDataReader dr = cmd.ExecuteReader())
- {
- while (dr.Read())
- {
- list.Add(dr[0].ToString());
- }
- }
- }
- }
- return list;
-
- }