62,073
社区成员
发帖
与我相关
我的任务
分享
<asp:Button id="BtnSerch" runat="server" Width="70px" Text="搜索" OnClick="BtnSerch_Click"></asp:Button>
<asp:Button ID="btnCurrent" runat="server" OnClick="btnCurrent_Click" Style="z-index: 100;
left: 10px; position: absolute; top: 49px" Text="现况" EnableTheming="True" />
public static string conn_trade2000; --webcofig业已定义了此连接串。
protected void btnCurrent_Click(object sender, EventArgs e)
{
//获取变量id
string strid = this.tboxid.Text;
//获取test中的数据
string sqlstr;
DataTable dt = new DataTable();
sqlstr = "select * from test where id='" + strid + "'";
dt = DBOperate.getTable(sqlstr, "test", con); --自已写的一个类中的函数
this.tboxA.Text = dt.Rows[0]["A"].ToString();
this.tboxB.Text = dt.Rows[0]["B"].ToString();
}