Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- string _connectionString = ("server=vrsbase-w2k3;" +
- "database=express;" +
- "user=sa;" +
- "password=");
- string _sql = string.Empty;
- SqlConnection conn = null;
- // 2. Create and open a connection object
- conn = new SqlConnection(_connectionString);
- // 3. Open the Connection
- conn.Open();
- for (int x = 1; x <= 50000; x++)
- {
- _sql =
- string.Format(
- @"INSERT INTO dbo.airway (number, name) VALUES ('{0}', 'Bobby Lee');", x);
- SqlCommand command = new SqlCommand(_sql, conn);
- string returnvalue = (string) command.ExecuteScalar();
- Console.WriteLine(string.Format("Writting record {0} -> Value ({1})", x, returnvalue));
- }
- conn.Close();
- }
Add Comment
Please, Sign In to add comment