资源简介
城市公交线路添加查询城市公交线路添加查询

代码片段和文件信息
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 = “此路线已经存在!请重新添加!!“;
this.name.Text = ““;
this.beg.Text = ““;
this.end.Text = ““;
}
conn.Close();
}
catch(Exception ex)
{
ex.ToString();
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 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动态温度曲线图
相关资源
- .net计件工资管理程序 啊
- powerdatagrid控件 源码
- 《WCF服务编程(第三版)》.pdf
- 初学Visual Basic 2010代码
- 网上购物商城系统完整版
- AutoMapper的使用
- 清华大学计算机系网络课程之模式识
- 某实验中学网站(源码+数据库)
- 学生综合素质测评
- 课程管理系统
- 加班管理系统本人自己写的.net 本人新
- 网上书店的设计
- 在线考试系统学生 老师 管理员
- 在线投票系统源代码+数据库设计+E-
- OA办公系统源代码+数据库
- 在线电子杂志浏览系统
- AjaxControlToolKit Ajax扩展控件
- 旅游网站系统项目开发
- 自己做的购物网站的毕业设计全套包
- 超市购物管理系统
- MVC三层架构音乐网站源码
- .net企业门户网站完整源码适合科技企
- 清华大学计算机系网络课程之编译原
- .net新闻发布系统,完整源代码。
- 高校教师工资绩效管理系统
- 网上购物商城源代码+毕业论文+开题报
- 物流信息发布平台
- 物流信息管理系统
- web课程设计 网上花店
- 进销存用户需求说明书用例图的描述
评论
共有 条评论