ASP.NET三层架构修改下,应该把什么移动到数据层 5
SqlConnectionsqlCon=SqlDbClass.getConn();zmqyhbDataSetds=newzmqyhbDataSet();zmqyhbDat...
SqlConnection sqlCon = SqlDbClass.getConn();
zmqyhbDataSet ds = new zmqyhbDataSet();
zmqyhbDataSet.用户表Row selectedRow;
public Safe()
{
InitializeComponent();
}
private void btnAdd_Click(object sender, EventArgs e)
{
DataRow newRow = ds.用户表.NewRow();
newRow[0] = txtUserID.Text.Trim();
newRow[1] = txtPassword.Text.Trim();
newRow[2] = txtName.Text.Trim();
if (rdnManager.Checked == true)
newRow[3] = "1";
else
newRow[3] = "0";
ds.用户表.Rows.Add(newRow);
SqlDataAdapter sqlAda = new SqlDataAdapter("select * from 用户表", sqlCon);
SqlCommandBuilder builder = new SqlCommandBuilder(sqlAda);
sqlAda.Update(ds.用户表);
ds.AcceptChanges();
MessageBox.Show("成功");
}
newRow[2] = txtName.Text.Trim(); 展开
zmqyhbDataSet ds = new zmqyhbDataSet();
zmqyhbDataSet.用户表Row selectedRow;
public Safe()
{
InitializeComponent();
}
private void btnAdd_Click(object sender, EventArgs e)
{
DataRow newRow = ds.用户表.NewRow();
newRow[0] = txtUserID.Text.Trim();
newRow[1] = txtPassword.Text.Trim();
newRow[2] = txtName.Text.Trim();
if (rdnManager.Checked == true)
newRow[3] = "1";
else
newRow[3] = "0";
ds.用户表.Rows.Add(newRow);
SqlDataAdapter sqlAda = new SqlDataAdapter("select * from 用户表", sqlCon);
SqlCommandBuilder builder = new SqlCommandBuilder(sqlAda);
sqlAda.Update(ds.用户表);
ds.AcceptChanges();
MessageBox.Show("成功");
}
newRow[2] = txtName.Text.Trim(); 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询