I have a script which contains some SQL code to create tables. this script contains something like this:
CREATE TABLE Customer
(
CustomerID integer PRIMARY KEY,
FirstName varchar(32) NOT NULL,
LastName varchar(32) NOT NULL,
Street varchar(32),
Phone varchar(32)
)
CREATE TABLE Supplier
(
SupplierID varchar(8) PRIMARY KEY,
Name varchar(32) NOT NULL,
Street varchar(32),
Phone varchar(32)
)
I used this code to run this script:
try
{
var content = File.ReadAllText("c:\\users\\vahid\\desktop\\DBAssignment5\\A3\\SchemaSetUp.sql");
using (var command = new OracleCommand(content) { Connection = conn })
{
command.ExecuteNonQuery();
}
}
catch (Exception ex)
{
Console.WriteLine("Something's wrong\n");
Console.WriteLine(ex.ToString());
}
When the script contains the code of creating just one table, it works well, but when I add codes to create more than one table, I face this exception:
Can anybody please tell me what's wrong and what should I do to fix this problem?
Thank you