Friday, March 16, 2012

Running TSQL with "Go" in ado.net

did the following:
added these references
and ran this code
     using (SqlConnection con = new SqlConnection (connstr))
     {
         con.Open();
         Server server = new Server(new ServerConnection(con));
         server.ConnectionContext.ExecuteNonQuery(grants);
      }
Thanx        

1 comment:

  1. Alter database statements did not work - I needed to run seperate commands

    ReplyDelete