![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
15/12/2011, 18:52
|
![Avatar de jaullo](http://static.forosdelweb.com/customavatars/avatar298871_1.gif) | | | Fecha de Ingreso: abril-2009
Mensajes: 994
Antigüedad: 15 años, 9 meses Puntos: 30 | |
Respuesta: Insert desde aspx (vb) Hola,
Es bastante sencillo, checa esto
string SqlString = "Insert Into Contacts (FirstName, LastName) Values (?,?)";
using (SqlConnection conn = new SqlConnection(ConnString))
{
using (SqlCommand cmd = new SqlCommand(SqlString, conn))
{
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("FirstName", txtFirstName.Text);
cmd.Parameters.AddWithValue("LastName", txtLastName.Text);
conn.Open();
cmd.ExecuteNonQuery();
}
}
Saludos,
Jason Ulloa
Microsoft Commnuty Contributor |