I have a GetAlertData() function that returns a Datatable. I call it like:
var dt = GetAlertData()
Debug mode behavior:
Case 1: When I do F11 all the time and go to the GetAlertData function, everything works fine and I get the correct table
Case 2: When I do F10 on this function and step over it, GetAlertData returns a table with all values ββfilled in as zero (incorrect). (The columns of my table are all floating point data types)
In release mode, the behavior is the same as pressing F10 in debug mode, that is, I get all zeros.
Any ideas on what could be causing, or that I might try to find a reason? Thanks..
Edit: my GetAlertData function is something like this.
internal static DataSet GetAlertData() { using (var sqlConnection = new SqlConnection(Constants.ConnectionString)) { const string sproc = @"[spo_GetAlertData]"; var cmd = new SqlCommand(sproc, sqlConnection) {CommandType = CommandType.StoredProcedure}; cmd.Parameters.Add("@TimeWindow", SqlDbType.Int); cmd.Parameters["@TimeWindow"].Value =2 cmd.Parameters.Add("@ThresholdTime", SqlDbType.Int); cmd.Parameters["@ThresholdTime"].Value = 2 var dsAnalysis = new DataSet(); var da = new SqlDataAdapter(cmd); da.Fill(dsAnalysis); if (dsAnalysis.Tables.Count > 0 && dsAnalysis.Tables[0].Rows.Count > 0) return dsAnalysis; return null; } }
source share