http://dl2.youkuaiyun.com/down4/20070719/19101125349.dll
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;

public
partial
class
Default8 : System.Web.UI.Page

...
{
MVC_M.MODEL a = new MVC_M.MODEL();
protected void Page_Load(object sender, EventArgs e)

...{
if (!IsPostBack)

...{
show1();
}
else

...{
Response.Write(@"<script>alert('您的操作成功﹗')</script>");
show1();
}
}
protected void Button1_Click(object sender, EventArgs e)

...{
insert1();
}
protected void Button2_Click(object sender, EventArgs e)

...{
delete1();
}
protected void Button3_Click(object sender, EventArgs e)

...{
update1();
}
private void show()

...{
a.Connstring = @"Data Source=JOHNSQLEXPRESS;Initial Catalog=test;Persist Security Info=True;User ID=sa";
GridView1.DataSource = a.GetData("select * from Table1");
GridView1.DataBind();
}
private void show1()

...{
string[] strParams = null;
object[] objValues = null;
a.Connstring = @"Server=johnsqlexpress;uid=sa;pwd=;database=test;";
GridView1.DataSource = a.GetData("proc_select", strParams, objValues);
GridView1.DataBind();
}
private void insert()

...{
a.Connstring = @"Data Source=JOHNSQLEXPRESS;Initial Catalog=test;Persist Security Info=True;User ID=sa";
a.exeSql("insert into Table1(TName) values('" + TextBox2.Text + "')");
show();
}
private void insert1()

...{

string[] strParams =...{ "@TName" };

object[] objValues =...{ TextBox2.Text };
a.Connstring = @"Server=johnsqlexpress;uid=sa;pwd=;database=test;";
if (a.exeSql("proc_insert", strParams, objValues) > 0)

...{
show1();
Response.Write(@"<script>alert('您的操作成功﹗')</script>");
}
else

...{
Response.Write(@"<script>alert('您的操作失敗﹗')</script>");
}
}
private void delete()

...{
a.Connstring = @"Data Source=JOHNSQLEXPRESS;Initial Catalog=test;Persist Security Info=True;User ID=sa";
a.exeSql("delete from Table1 where TID=" + Convert.ToInt32(TextBox1.Text));
show();
}
private void delete1()

...{

string[] strParams = ...{ "@TID" };

object[] objValues = ...{ TextBox1.Text};
a.Connstring = @"Server=johnsqlexpress;uid=sa;pwd=;database=test;";
if (a.exeSql("proc_delete", strParams, objValues) > 0)

...{
show1();
Response.Write(@"<script>alert('您的操作成功﹗')</script>");
}
else

...{
Response.Write(@"<script>alert('您的操作失敗﹗')</script>");
}
}
private void update()

...{
a.Connstring = @"Data Source=JOHNSQLEXPRESS;Initial Catalog=test;Persist Security Info=True;User ID=sa";
a.exeSql("update Table1 set TName='" + TextBox2.Text + "' where TID=" + Convert.ToInt32(TextBox1.Text));
show();
}

private void update1()

...{

string[] strParams = ...{ "@TID", "@TName" };

object[] objValues = ...{ TextBox1.Text,TextBox2.Text};
a.Connstring = @"Server=johnsqlexpress;uid=sa;pwd=;database=test;";
if (a.exeSql("proc_update", strParams, objValues) > 0)

...{
show1();
Response.Write(@"<script>alert('您的操作成功﹗')</script>");
}
else

...{
Response.Write(@"<script>alert('您的操作失敗﹗')</script>");
}
}
}