3、?]id
4、int□—columnsnvarchar(50)Otitlenvarchar(50)畫contentsnvarchar(50)畫timedatetime畫112.在VS2010新建一個C#語言的web應(yīng)用程序項(xiàng)目如下圖所示,按照實(shí)驗(yàn)要求,新建一個Newspublish的web項(xiàng)冃,然后新建C#的web窗體,名字是NewsPublish:▲闔Newspublish>囤Propertiesl>引用0QJAccountApp_Data>OScripts>i_JStyles0圉About.nspx0圉Default.aspx0』G
5、lobal.asax川圄NewsPublish.nspx也NewsPublish.aspx.es皆NewsPublish.aspx.designer.es3?設(shè)計頁面模板如下圖所示,拖動控件按如下的方式擺放:釆用毗b方式發(fā)布新聞idcolumnstitlecontentstime3333333332016/5/3120:20:2743332016/5/3120:20:10ID:(必填,插入數(shù)據(jù)時不用填)新聞欄目:顯示該ID的內(nèi)容新聞標(biāo)題:新聞內(nèi)容:插入冊除修改4.實(shí)現(xiàn)后臺功能,查詢數(shù)據(jù)庫(1)使用Configuration
6、Manager和SqlConnection函數(shù)連接數(shù)據(jù)庫{publicSqlConnectionGetconn(){stringc
7、onstr=ConfigurationJIanager.ConnectionStrings[NewsMessageCSqlConnectioncon=newSqlConnection(constr):returncon;}protectedvoidPage_Load(objectsender,EverrtArgse)(2)功能…,插入新的新聞到數(shù)據(jù)庫中SqIConnectioncon=Getconn();con.Open();stringstrsql="INSERTINTOnewsVALUES(*z,+TextBoxl.T
8、ext+"+TextBox2.Text+"+TextBox3.Text+'z,+DateTime.Now.ToStringO+,z,)”;SqlCommandemd二newSqlCommand(strsql,con);if(cmd.ExecuteNonQuery0>0){GridViewl.DataBind();Response.Write(,,