日期:2014-05-16 浏览次数:21189 次
<td><asp:Button ID="Submit1" runat="server" Text="添加" accesskey="1" tabindex="-1" onclick="Submit1_Click" />Alt+1</td>
DataBaseClass db = new DataBaseClass();
//添加到数据库
int ret = db.ExeSql2(sql, pa);
if (ret > 0)
{
ListItem item = new ListItem(TextBox1.Text.Trim() + "(" + TextBox2.Text.Trim() + ")", id.ToString());
ListBox1.Items.Add(item);
ListBox1.Focus();
this.ListBox1.SelectedItem.Value = id.ToString();
ShowMessageBox("添加成功1!");
}
else
{
ShowMessageBox("新增失败!");
}