public string Name;
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection sqlcon = new SqlConnection("Data Source=007-324a07be4d8;Initial Catalog=db_ac;Integrated Security=SSPI;user ID=;PWD=;");
string sqltopadcom = "select * from tb_news where news_id='1' ";
SqlDataAdapter myda = new SqlDataAdapter(sqltopadcom, sqlcon);
Name =
Page.DataBind();
}
前台<%=Name%>哪个Name应该怎样写 前台才能显示数据啊 谢谢各位啦
后台
div. innerHTML ="";
InnerHtml应该是大写的I
错误 1 “System.Web.UI.HtmlControls.HtmlGenericControl”不包含“InnerHTML”的定义,并且找不到可接受类型为“System.Web.UI.HtmlControls.HtmlGenericControl”的第一个参数的扩展方法“InnerHTML”(是否缺少 using 指令或程序集引用?) E:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\WebSites\WebSite27\Default.aspx.cs 23 11 E:\...\WebSite27\
最好别叫div,刚才我是随手敲的
{
public string Name;
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection sqlcon = new SqlConnection("Data Source=007-324a07be4d8;Initial Catalog=db_ac;Integrated Security=SSPI;user ID=;PWD=;");
string sqltopadcom = "select * from tb_news where news_id='1'";
SqlDataAdapter myda = new SqlDataAdapter(sqltopadcom, sqlcon);
a.InnerHTML = "news_leiyong";
Page.DataBind();
}
}
private string _name;
public string Name;
{get{return _name;}set{_name = value;}}
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection sqlcon = new SqlConnection("Data Source=007-324a07be4d8;Initial Catalog=db_ac;Integrated Security=SSPI;user ID=;PWD=;");
string sqltopadcom = "select * from tb_news where news_id='1' ";
SqlDataAdapter myda = new SqlDataAdapter(sqltopadcom, sqlcon);
DataSet ds = new DataSet();
try
{
sqlcon.Open();
myda.Fill(ds);
}
catch
{
//自己处理
}
_name = ds.Table[0].Row[0]["tb_news"].ToString()
Page.DataBind();
}