Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/08/2008, 08:06
pagu
 
Fecha de Ingreso: julio-2008
Mensajes: 22
Antigüedad: 15 años, 9 meses
Puntos: 0
Respuesta: Valor autonumerico SQL

Al final lo he solucionado así:

conexion = new SqlConnection(conString);
conexion.Open();

String con = "SELECT Scope_Identity() as id;";
DataSet ds = new DataSet();
adapter = new SqlDataAdapter(con, conexion);
adapter.Fill(ds);

return int.Parse(ds.Tables[0].Rows[0]["id"].ToString());


Gracias por tu respuesta. Un saludo.