@rg070836rg
2015-08-16T07:07:56.000000Z
字数 872
阅读 1741
data_structure由于需求,需要我了解位图索引,这之前,我是第一次听说位图索引,
using System.Configuration;using System.Data;using System.Data. (1) ;protected void ButtonOK_Click(object sender, EventArgs e){// 新建数据库连接,连接到SQL SERVER数据库System.Data.SqlClient.SqlConnection conn = new SqlConnection();conn.ConnectionString = ConfigurationManager.ConnectionStrings[“ (2) "].ConnectionString;SqlCommand cmd = new SqlCommand(); // 新建Command对象cmd.Connection = (3) ;cmd.CommandText="Insert into [Topic] ( [Title],[Content]) Values( (4) )";cmd.CommandType = CommandType.Text;// 添加查询参数对象,并给参数赋值cmd.SqlParameters.AddWithValue("@Title", (5) );cmd.SqlParameters.AddWithValue("@Content ", (6) );try {conn. (7) ; // 打开数据库连接cmd. (8) ; //将添加记录}catch (SqlException sqlException){ Response.Write(sqlException.Message); } // 显示连接异常信息finally {if (conn.State == ConnectionState.Open)conn. (9) ; //关闭连接}}protected void ButtonBack_Click(object sender, EventArgs e) {Response. (10) ("TopicList.aspx");}
