2016-01-21 231 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