面对一些用户无法查看我的系统但以某种方式他们大多数人都能查看它的问题。无法查看WPF浏览器
我附上了一些他们得到的错误的屏幕截图。这个错误在主页的构造函数中被捕获。
看到在屏幕上它也抱怨一种叫做FillDataGrid()
的方法,下面是一段代码,当程序启动时填充网格。
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");
//}
}
你读你张贴的截图信息??? “...在登录过程中发生错误”...您的所有用户是否都有权访问数据库? –
用户不能直接访问数据库,但是他们能够使用UI读取和写入数据。 “Data Source = myServer; Initial Catalog = DBAssetControl; User ID = ismuser; Password = ismuser” 这是我的连接字符串,因此使用此字符串用户可以访问数据库。 这个奇怪的部分是,20个中只有2个不能查看。 – Dux