2
« en: Miércoles 15 de Octubre de 2008, 03:07 »
TENGO Q ENCONTRAR 3 ERRORES EN ESTE CODIGO... QUIEN ME COLABORA ?
string sSQL = "create database " + sNomDataBase;
SqlCommand comando = new SqlCommand();
comando.Connection = la_conexion;
comando.CommandText = sSQL;
comando.ExecuteNonQuery();
Console.WriteLine("Se Creo Base de Datos {0}", sNomDataBase);
sSQL = "create table T01(id int identity(5,5) primary key,numero int,Carreta nvarchar(50))";
comando.CommandText = sSQL;
comando.ExecuteNonQuery();
Console.WriteLine("Se creo tabla");
Random r = new Random(DateTime.Now.Second);
sSQL = "insert into TO1 (numero,carreta) values(" + r.Next(0, 999).ToString() + ",'Lero Lero')";
comando.CommandText = sSQL;
r = new Random(DateTime.Now.Second);
sSQL = "insert into T01 (numero,carreta) values(" + r.Next(0, 999).ToString() + ",'Lero Lero')";
comando.CommandText = sSQL;
comando.ExecuteNonQuery();
r = new Random(DateTime.Now.Second + r.Next(-500, 5000) * r.Next(3, 7));
sSQL = "insert into T01 (numero,carreta) values(" + r.Next(0, 999).ToString() + ",'Lero Lero')";
comando.CommandText = sSQL;
comando.ExecuteNonQuery();
r = new Random(DateTime.Now.Second + r.Next(-500, 5000) * r.Next(3, 7));
sSQL = "insert into T01 (numero,carreta) values(" + r.Next(0, 999).ToString() + ",'Lero Lero')";
comando.CommandText = sSQL;
comando.ExecuteNonQuery();
Console.WriteLine("Se insertaron filas");