W
whx_xxp
Unregistered / Unconfirmed
GUEST, unregistred user!
各位大侠: 初学c#,请教
private void Page_Load(object sender, System.EventArgs e)
{
DataSet myds;
SqlDataAdapter mysda;
if (!this.IsPostBack)
{
string constr="server=192.168.1.2;uid=sa;pwd=sa;database=farmer";
SqlConnection conn=new SqlConnection(constr);
string sql="SELECT max(序号) FROM 进帐单";
mysda=new SqlDataAdapter (sql,conn);
SqlCommandBuilder builder=new SqlCommandBuilder (mysda);
myds=new DataSet();
mysda.Fill (myds,"进帐单");
//this.TextBox1.Text=??????
}
}
想把max(序号)显示到textbox1中,?????处应该怎么写?
private void Page_Load(object sender, System.EventArgs e)
{
DataSet myds;
SqlDataAdapter mysda;
if (!this.IsPostBack)
{
string constr="server=192.168.1.2;uid=sa;pwd=sa;database=farmer";
SqlConnection conn=new SqlConnection(constr);
string sql="SELECT max(序号) FROM 进帐单";
mysda=new SqlDataAdapter (sql,conn);
SqlCommandBuilder builder=new SqlCommandBuilder (mysda);
myds=new DataSet();
mysda.Fill (myds,"进帐单");
//this.TextBox1.Text=??????
}
}
想把max(序号)显示到textbox1中,?????处应该怎么写?