Tag: aspdotnetstorefront

从IDataReader读取字段时Intermittent System.IndexOutOfRangeException

我在代码中有一个非常奇怪的问题,我不希望它会失败。 它是一个网站,有一些流量但不是很大,基于AspDotNetStoreFront。 尝试从阅读器读取数据库字段时,站点间歇性崩溃。 这发生在网站上的各个地方。 这个代码的一个例子是在对象pValue = rs [“PropertyValueString”]的行下面; private Dictionary GetPropertValuePairs(string userName) { string query = string.Format(“select PropertyName, PropertyValueString from dbo.profile with(nolock) where CustomerGUID = {0} and StoreID = {1}”, DB.SQuote(userName),AppLogic.StoreID()); Dictionary propertyValues = new Dictionary(); using (SqlConnection conn = new SqlConnection(DB.GetDBConn())) { conn.Open(); using (IDataReader rs = DB.GetRS(query, conn)) { while (rs.Read()) { string […]