lblname
lblFName
txtName
txtFName
btnInsert
EMPDB
Table emp
ID
int
Name = varchar(50)
_Name = varachar(50)
sqlDataSource
SqlDS
protected void btnInsert_Click(object sender, EventArgs e) { SqlDS.InsertCommandType = SqlDataSourceCommandType.Text; SqlDS.InsertCommand = "Insert into emp (Name,F_Name) VALUES (@Name, @F_Name)"; SqlDS.InsertParameters.Add("Name", txtName.Text); SqlDS.InsertParameters.Add("F_Name", txtFName.Text); SqlDS.Insert(); txtName.Text = ""; txtFName.Text = ""; }
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)