62,046
社区成员
发帖
与我相关
我的任务
分享
string title = this.TextBox3.Text.Trim();
using (SqlConnection conn = new SqlConnection(SQLHelper.ConnectionString))
{
SqlCommand myCommand = new SqlCommand();
myCommand.CommandText = "insert into newsinfo(title) values(@title)";
myCommand.Parameters.Add("@title", SqlDbType.VarChar, 50);
myCommand.Parameters["@title"].Value = title ;
myCommand.Connection = conn;
conn.Open();
myCommand.ExecuteNonQuery();
conn.Close();
}