📄 mycodebehind
字号:
using System;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
public class MyCodeBehind : Page {
public TextBox Name;
public DropDownList Category;
public void SubmitBtn_Click(Object sender, EventArgs e) {
if (Page.IsValid) {
SQLConnection myConnection = new SQLConnection("server=localhost;uid=sa;pwd=;database=pubs");
SQLDataSetCommand myCommand = new SQLDataSetCommand("select * from Titles where type='" + Category.SelectedItem.Value + "'", myConnection);
DataSet ds = new DataSet();
myCommand.FillDataSet(ds, "Titles");
MyList.DataSource = ds.Tables["Titles"].DefaultView;
MyList.DataBind();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -