您目前尚未登陆,请选择【登陆】或【注册
首页->全站代码->小范企业管理源码>>admin/AdminInfo.aspx.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:小范企业管理源码


当前文件路径:XiaoFanWeb/admin/AdminInfo.aspx.cs 文件类型
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11 12using System.Data.OleDb; 13public partial class admin_AdminInfo : System.Web.UI.Page 14{ 15 protected void Page_Load(object sender, EventArgs e) 16 { 17 huoqu(); 18 } 19 protected void Button1_Click(object sender, EventArgs e) 20 { 21 try 22 { 23 string txt1,txt2; 24 txt1=tb_name.Text.ToString(); 25 txt2=Tel.Text.ToString(); 26 if (txt1=="" || txt2=="") 27 { 28 Response.Redirect("adminInfo.aspx"); 29 } 30 OleDbConnection oledbcon = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=" + HttpContext.Current.Server.MapPath(@"~/App_Data/dbs.mdb")); 31 //string cmdString = "update FZ_orders set (Name,Address,Mail,,Tel,Fax,CopyRight,QQ,TimeToTime,URL,Info,Addtime)" + 32 ////"values('" + tb_name.Text.ToString() + "''" + Address.Text.ToString() + "'" + 33 //"'" + Email.Text.ToString() + "''" + .Text.ToString() + "''" + Tel.Text.ToString() + "'" + 34 //"'" + Fax.Text.ToString() + "''" + CopyRight.Text.ToString() + "''" + QQ.Text.ToString() + "'" + 35 //"'" + TimeToTime.Text.ToString() + "''" + URL.Text.ToString() + "''" + Info.Text.ToString() + "''" + DateTime.Now + "')"; 36 //更新数据代码 37 string upString = "update FZ_orders set Name='" + tb_name.Text.ToString() + "',"+ 38 "Address='" + Address.Text.ToString() + "'," + 39 "Mail='" + Email.Text.ToString() + "',"+ 40 "Zip='" + Zip.Text.ToString() + "'," + 41 "Tel='" + Tel.Text.ToString() + "'," + 42 "Fax='" + Fax.Text.ToString() + "'," + 43 "CopyRight='" + CopyRight.Text.ToString() + "'," + 44 "QQ='" + QQ.Text.ToString() + "'," + 45 "TimeToTime='" + TimeToTime.Text.ToString() + "'," + 46 "URL='" + URL.Text.ToString() + "'," + 47 "Info='" + Info.Text.ToString() + "'," + 48 "Addtime='" +DateTime.Now+ "'"; 49 50 oledbcon.Open(); 51 OleDbCommand cmd = new OleDbCommand(upString, oledbcon); 52 cmd.ExecuteNonQuery(); 53 oledbcon.Close(); 54 55 } 56 catch(Exception M) 57 { 58 Response.Write(M.Message); 59 } 60 finally 61 { 62 huoqu(); 63 } 64 } 65 protected void huoqu() 66 { 67 if (!IsPostBack) 68 { 69 try 70 { 71 OleDbConnection oledbcon = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=" + HttpContext.Current.Server.MapPath(@"~/App_Data/dbs.mdb")); 72 string cmdString = "select * from FZ_orders"; 73 oledbcon.Open(); 74 OleDbDataAdapter oda = new OleDbDataAdapter(cmdString, oledbcon); 75 DataSet ds = new DataSet(); 76 oda.Fill(ds, "temp"); 77 tb_name.Text = ds.Tables["temp"].Rows[0]["Name"].ToString(); 78 Address.Text = ds.Tables["temp"].Rows[0]["Address"].ToString(); 79 Email.Text = ds.Tables["temp"].Rows[0]["Mail"].ToString(); 80 Zip.Text = ds.Tables["temp"].Rows[0]["Zip"].ToString(); 81 Tel.Text = ds.Tables["temp"].Rows[0]["Tel"].ToString(); 82 Fax.Text = ds.Tables["temp"].Rows[0]["Fax"].ToString(); 83 CopyRight.Text = ds.Tables["temp"].Rows[0]["CopyRight"].ToString(); 84 QQ.Text = ds.Tables["temp"].Rows[0]["QQ"].ToString(); 85 TimeToTime.Text = ds.Tables["temp"].Rows[0]["TimeToTime"].ToString(); 86 URL.Text = ds.Tables["temp"].Rows[0]["URL"].ToString(); 87 Info.Text = ds.Tables["temp"].Rows[0]["Info"].ToString(); 88 oledbcon.Close(); 89 } 90 catch (Exception M) 91 { 92 Response.Write(M.Message); 93 } 94 } 95 } 96} 97
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:小范企业管理源码

- 网博垂直搜索引擎完全开源版

- 某医院网站管理后台源码

- Asp.net通用人力资源管理系统..

- ShangducmsTeamsuit! Sp1开源版

- 简约精致的Asp.net留言本源码

- Asp.net简单XML留言本源代码

- 替某公司写的一个小论坛(供..

- 面向对象实例之数据操作项目源码

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号