   new to asp.net.....variable problem
  Hey everyone, I know I must just be going something stupid, but I can't find out why this isn't working. I want to output the title variable string. Thanks!<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %><%@ Import Namespace="System" %><%@ Import Namespace="System.Data" %><%@ Import Namespace="System.Data.SqlClient" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><%    string myTitle = "";    SqlConnection objConnect = new SqlConnection("Data Source=DIGITAL-5TLT790;Initial Catalog=drse;Integrated Security=True;Pooling=False");    objConnect.Open();    SqlCommand objCommand = new SqlCommand("SELECT * FROM [misc]", objConnect);    SqlDataReader objReader = objCommand.ExecuteReader();    while (objReader.Read() == true)    {   myTitle = objReader["master_title"].ToString();    }%><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server">    <title><%=myTitle %></title></head><body>    <form id="form1" runat="server">    <div>   </div>    </form></body></html>
  According to MSDN, you may need a Close() after that while loop. Other than that W3schools and MSDN, says the html part of the script is fine.   ;  not my thread but.... anyone know the answer?   ;  A) better placed in the Web Development ForumB) Response.Write(myString); (Response of type HttpResponse is a property of the page context)C) You shouldn't be putting logic *in* the page with ASP.NET. It's bad design.   