資源簡介
城市公交線路添加查詢城市公交線路添加查詢

代碼片段和文件信息
using?System;
using?System.Data;
using?System.Configuration;
using?System.Collections;
using?System.Web;
using?System.Web.Security;
using?System.Web.UI;
using?System.Web.UI.WebControls;
using?System.Web.UI.WebControls.WebParts;
using?System.Web.UI.HtmlControls;
using?System.Data.SqlClient;
public?partial?class?add?:?System.Web.UI.Page
{
????protected?void?Page_Load(object?sender?EventArgs?e)
????{
????????if?(!IsPostBack)
????????{
?
????????}
????}
????protected?void?but_Click(object?sender?EventArgs?e)
????{
????????string?busno?=?this.name.Text;
????????string?origin?=?this.beg.Text;
????????string?terminal?=?this.end.Text;
????????try
????????{
????????????SqlConnection?conn?=?new?SqlConnection(System.Configuration.ConfigurationManager.AppSettings[“bus“]);
????????????conn.Open();
????????????SqlCommand?com?=?new?SqlCommand(“select?count(*)?from?businfo?where?busno=‘“?+?busno?+?“‘“?conn);
????????????int?count?=?Convert.ToInt32(com.ExecuteScalar());
????????????if?(count?!=?1)
????????????{
????????????????com.CommandText?=?“insert?into?businfo(busnooriginterminal)values(@busno@origin@terminal)“;
????????????????SqlParameter?para?=?new?SqlParameter(“@busno“?SqlDbType.VarChar?10);
????????????????para.Value?=?busno;
????????????????com.Parameters.Add(para);
????????????????para?=?new?SqlParameter(“@origin“?SqlDbType.VarChar?20);
????????????????para.Value?=?origin;
????????????????com.Parameters.Add(para);
????????????????para?=?new?SqlParameter(“@terminal“?SqlDbType.VarChar?20);
????????????????para.Value?=?terminal;
????????????????com.Parameters.Add(para);
????????????????com.ExecuteNonQuery();
????????????????this.mes.Text?=?“此路線添加成功!!“;
????????????????this.name.Text?=?““;
????????????????this.beg.Text?=?““;
????????????????this.end.Text?=?““;
????????????}
????????????else
????????????{
????????????????this.mes.Text?=?“此路線已經(jīng)存在!請重新添加??!“;
????????????????this.name.Text?=?““;
????????????????this.beg.Text?=?““;
????????????????this.end.Text?=?““;
????????????}
??????????
????????????conn.Close();
????????
????????}
????????catch(Exception?ex)
????????{
????????????ex.ToString();
????????}
????}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄??????????0??2008-12-12?08:48??Bus\App_Data
?????文件?????573440??2008-12-12?10:36??Bus\db\businfoDB_log.LDF
?????文件????2293760??2008-12-12?10:36??Bus\db\businfoDB.mdf
?????目錄??????????0??2008-12-12?10:36??Bus\db
?????文件???????2280??2008-12-12?09:48??Bus\add.aspx.cs
?????文件???????1870??2008-12-12?09:49??Bus\add.aspx
?????文件???????2433??2008-12-12?09:09??Bus\Web.config
?????文件???????2030??2008-12-12?09:22??Bus\index.aspx.cs
?????文件???????1495??2008-12-12?09:23??Bus\index.aspx
?????目錄??????????0??2008-12-12?08:48??Bus
-----------?---------??----------?-----??----
??????????????2877308????????????????????10
- 上一篇:C超級爬蟲.zip
- 下一篇:UDP動態(tài)溫度曲線圖
評論
共有 條評論