求"ASP.NET2.0下含有DropDownList的GridView编辑、删除的完整例子!" 里的自定义函数?
我在网上看到有好多“ASP.NET2.0下含有DropDownList的GridView编辑、删除的完整例子!”,在这个教程的里有好多自定义函数如:GetDs(strSql),RunSql(str),BuilderEdit,BuilderEditClose()等等,请问那位兄弟有这些自定义函数?
那个例子的部分代码如下:
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
...{
string ID = GridView1.DataKeys[e.RowIndex].Values[0].ToString();
string DB1_1 = ((TextBox)GridView1.Rows[e.RowIndex].FindControl( "TextBox1 ")).Text;
//string DB1_2 = ((TextBox)GridView1.Rows[e.RowIndex].FindControl( "TextBox2 ")).Text;
string DB1_2 = (((DropDownList))GridView1.Rows[e.RowIndex].FindControl( "ddlXL ")).SelectedItem.Text;
//判断表单项是否有空并给出提示信息
if (DB1_1 == " " || DB1_2 == " ")
...{
conn.Alert( "请输入完整信息! ", Page);
return;
}
try
...{
conn.BuilderEdit( "select * from DB1 where DB1_1 = ' " + ID + " ' ");
conn.dr[ "DB1_1 "] = DB1_1;
conn.dr[ "DB1_2 "] = DB1_2;
conn.BuilderEditClose();
}
catch (OracleException err)
...{
if (err.Code.ToString() == "1 ")
conn.Alert( "错误:已存在具有相同主键的记录 ", Page);
else
conn.Alert( "错误:未能添加记录 ", Page);
}
Response.Write( " <script language= 'javascript '> alert( '数据已被保存! '); </script> ");
//返回浏览状态
GridView1.EditIndex = -1;
GridViewBind();