Search code examples
c#sqlsap-ase

How to do multiple inserts into sybase from c# at once


I am new to sybase db. I am trying inset multiple rows using following code

string sql="INSERT INTO dbo.table1 (c1,c2,c3)
     VALUES ('C1','c2','c2'); INSERT INTO dbo.table1 (c1,c2,c3)
     VALUES ('C1','c2','c2'); ";


                Sybase.Data.AseClient.AseCommand cmd = new Sybase.Data.AseClient.AseCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = sql;
                cmd.CommandTimeout = 30 * 60;`enter code here`
                cmd.Connection = conn;
                cmd.ExecuteNonQuery();

and i am getting the error "Incorrect syntax near ';'." at the end of the first statement? Any ideas?


Solution

  • I figured out there is no need for ; or GO. Thanks a lot for the input