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();
- // Set up a command with the given query and associate
- // this with the current connection.
- 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;
- }
Goran BibicPosted Aug 22, 2018, 12:27 AM
Goran BibicPosted Aug 22, 2018, 12:25 AM
Sai Kumar KoonaPosted Aug 21, 2018, 8:11 AM