Click here to Skip to main content
15,913,758 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Modal show information Pin
Member 1490896420-Oct-20 2:47
Member 1490896420-Oct-20 2:47 
GeneralRe: Modal show information Pin
ZurdoDev20-Oct-20 2:48
professionalZurdoDev20-Oct-20 2:48 
AnswerRe: Modal show information Pin
ZurdoDev20-Oct-20 5:01
professionalZurdoDev20-Oct-20 5:01 
QuestionDisplay Tabs and details in ASP.Net MVC Pin
sagarpallavi18-Oct-20 17:21
sagarpallavi18-Oct-20 17:21 
AnswerRe: Display Tabs and details in ASP.Net MVC Pin
Richard MacCutchan18-Oct-20 21:55
mveRichard MacCutchan18-Oct-20 21:55 
QuestionFullCalendar button or click in day to add new event Pin
Member 1490896413-Oct-20 6:48
Member 1490896413-Oct-20 6:48 
QuestionRe: FullCalendar button or click in day to add new event Pin
ZurdoDev13-Oct-20 9:09
professionalZurdoDev13-Oct-20 9:09 
QuestionPDF to Images for encryption Pin
Member 105489775-Oct-20 4:30
Member 105489775-Oct-20 4:30 
AnswerRe: PDF to Images for encryption Pin
F-ES Sitecore6-Oct-20 0:07
professionalF-ES Sitecore6-Oct-20 0:07 
GeneralRe: PDF to Images for encryption Pin
Member 105489776-Oct-20 3:21
Member 105489776-Oct-20 3:21 
GeneralRe: PDF to Images for encryption Pin
F-ES Sitecore6-Oct-20 5:26
professionalF-ES Sitecore6-Oct-20 5:26 
GeneralRe: PDF to Images for encryption Pin
Member 105489776-Oct-20 5:57
Member 105489776-Oct-20 5:57 
GeneralRe: PDF to Images for encryption Pin
Member 105489776-Oct-20 6:00
Member 105489776-Oct-20 6:00 
GeneralRe: PDF to Images for encryption Pin
F-ES Sitecore6-Oct-20 6:08
professionalF-ES Sitecore6-Oct-20 6:08 
GeneralRe: PDF to Images for encryption Pin
Member 105489776-Oct-20 6:52
Member 105489776-Oct-20 6:52 
GeneralRe: PDF to Images for encryption Pin
F-ES Sitecore6-Oct-20 10:45
professionalF-ES Sitecore6-Oct-20 10:45 
GeneralRe: PDF to Images for encryption Pin
Member 105489777-Oct-20 7:00
Member 105489777-Oct-20 7:00 
GeneralRe: PDF to Images for encryption Pin
Member 105489776-Oct-20 3:22
Member 105489776-Oct-20 3:22 
QuestionDynamically added controls effecting other controls Pin
Member 149556174-Oct-20 11:22
Member 149556174-Oct-20 11:22 
AnswerRe: Dynamically added controls effecting other controls Pin
Richard Deeming5-Oct-20 2:55
mveRichard Deeming5-Oct-20 2:55 
GeneralRe: Dynamically added controls effecting other controls Pin
Member 149416716-Oct-20 1:16
Member 149416716-Oct-20 1:16 
Questiontrying to get some measurement data to ASP from Microsoft SQL? Pin
auting824-Oct-20 11:07
auting824-Oct-20 11:07 
AnswerRe: trying to get some measurement data to ASP from Microsoft SQL? Pin
Richard Deeming5-Oct-20 2:53
mveRichard Deeming5-Oct-20 2:53 
Well, your view is wrong to start with. You've put:
Razor
<td> "measurement.Timestamp</td>
when it should be:
Razor
<td> @measurement.Timestamp</td>

You should also be wrapping the disposable objects in a using block:
C#
public List<Measurement> GetMeasurementParameters()
{
    const string connectionString = "DATA SOURCE=LAPTOP-1T8PALVT\\CITADEL;UID=LAPTOP-1T8PALVT\\AdisP;DATABASE=MEASUREMENTDATA;Integrated Security = True;" ;
    const string sqlQuery = "Select Timestamp, MeasurementValue, ControlValue from MEASUREMENTDATA";

    List<Measurement> measurmentParameterList = new List<Measurement>();
    using (SqlConnection con = new SqlConnection(connectionString))
    using (SqlCommand cmd = new SqlCommand(sqlQuery, con))
    {
        con.Open();
        using (SqlDataReader dr = cmd.ExecuteReader())
        {
            while (dr.Read())
            {
                Measurement measurementParameter = new Measurement();
                measurementParameter.Timestamp = dr["TimeStamp"].ToString();
                measurementParameter.MeasurementValue = dr["MeasurementValue"].ToString();
                measurementParameter.ControlValue = dr["ControlValue"].ToString();
                measurmentParameterList.Add(measurementParameter);                  
            }
        }
    }

    return measurmentParameterList;       
}

Beyond that, we can't help you. You haven't told us what you mean by "some code text", and you haven't shown us any of the data from your database.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

QuestionComplex View Model with Nested Item List / ModelState Pin
Guillermo Perez18-Sep-20 15:49
Guillermo Perez18-Sep-20 15:49 
AnswerRe: Complex View Model with Nested Item List / ModelState Pin
Richard Deeming27-Sep-20 22:21
mveRichard Deeming27-Sep-20 22:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.