qq_夏夏_1
2016-07-18 22:42
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using Common; namespace WebApplication2 { public partial class Alter : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { } else { int id = Convert.ToInt32(Request.QueryString["id"]); SqlDataReader reader = DbHelperSQL.ExecuteReader("select * from Nows where id = " + id, null); NewObj obj = new NewObj(); if (reader.Read()) { obj.ID = Convert.ToInt32(reader["ID"]); obj.Type = Convert.ToInt32(reader["Type"]); obj.Title = Convert.ToString(reader["Title"]); obj.Addtime = Convert.ToDateTime(reader["Addtime"]); } textBoxID.Text = obj.ID.ToString(); textBoxType.Text = obj.Type.ToString(); textBoxTitle.Text = obj.Title; textBoxAdddatetime.Text = obj.Addtime.ToString(); reader.Close(); } } protected void btndelete_Click(object sender, EventArgs e) { int id = Convert.ToInt32(textBoxID.Text); string Title = textBoxTitle.Text; string datetime = textBoxAdddatetime.Text; int type = Convert.ToInt32(textBoxType.Text); DbHelperSQL.ExecuteSql("delete Nows where ID=" + id); } } }
这问的是什么,代码太长,没心思看
C#开发轻松入门
254118 学习 · 1459 问题
相似问题