Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/12/2011, 18:52
Avatar de jaullo
jaullo
 
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
__________________
http://geekswithblogs.net/jaullo/Default.aspx
Si te he ayudado regalame Karma positivo!!!