2016-01-21 115 views
0

面對一些用戶無法查看我的系統但以某種方式他們大多數人都能查看它的問題。無法查看WPF瀏覽器

我附上了一些他們得到的錯誤的屏幕截圖。這個錯誤在主頁的構造函數中被捕獲。

看到在屏幕上它也抱怨一種叫做FillDataGrid()的方法,下面是一段代碼,當程序啓動時填充網格。

Image

public void FillDataGrid() 
{ 

    //try 
    //{ 
     //Connection String 
     String config = Properties.Settings.Default.ConnStr; 
     //ConfigurationManager.ConnectionStrings["IMS.APP.IM.ISMAssetControl.Properties.Settings.ConnSt"].ConnectionString; 

     SqlConnection conn = new SqlConnection(config); 

     //Opening Connection String and fetching the query 
     conn.Open(); 

     String cmdString; 

     SqlConnection con = new SqlConnection(config); 

     cmdString = "execute sp_returnAllAssets"; 

     SqlCommand cmd = new SqlCommand(cmdString, con); 
     //cmd.CommandType = CommandType.Text; 
     SqlDataAdapter sda = new SqlDataAdapter(cmd); 

     //Here first we loaded Employee database table in a DataTable object and then bind it to the DataGrid’s ItemsSource property. 
     dt = new DataTable(cmdString); 
     sda.Fill(dt); 
     int i = dt.Rows.Count; 
     grdAssetSummary.ItemsSource = dt.DefaultView; 

    //} 
    //catch (SqlException ex) 
    //{ 
    // MessageBox.Show("error"); 
    //} 
} 
+1

你讀你張貼的截圖信息??? 「...在登錄過程中發生錯誤」...您的所有用戶是否都有權訪問數據庫? –

+0

用戶不能直接訪問數據庫,但是他們能夠使用UI讀取和寫入數據。 「Data Source = myServer; Initial Catalog = DBAssetControl; User ID = ismuser; Password = ismuser」 這是我的連接字符串,因此使用此字符串用戶可以訪問數據庫。 這個奇怪的部分是,20箇中只有2個不能查看。 – Dux

回答

0

正在面臨這樣的錯誤不能訪問數據庫的用戶。您可以檢查數據庫和數據庫服務器權限。

您可能正在使用局域網組/活動目錄進行身份驗證,然後我假設Windows身份驗證。如果不是,則應該授予用戶訪問權限。

即使他們有機會,你可以檢查,如果他們有機會獲得執行存儲過程execute sp_returnAllAssets

+0

用戶不能直接訪問數據庫,但是他們能夠使用UI讀取和寫入數據。 「Data Source = myServer; Initial Catalog = DBAssetControl; User ID = ismuser; Password = ismuser」這是我的連接字符串,因此使用此字符串用戶可以訪問數據庫。這個奇怪的部分是,20箇中只有2個是無法查看的。 – Dux