Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
提供在数据库服务器上执行 SQL 所需的 SAConnection 对象。
Public Shared ReadOnly Property Connection As SAConnection
public SAConnection Connection {get;}
已与服务器建立连接。无需使用 SAConnection 建立连接。使用与以下内容类似的语句获取连接对象:
SAConnection _conn = SAServerSideConnection.Connection;
以下示例获取 SAConnection 对象,然后执行 SQL 语句创建表。
private static void GetConnection() { SAConnection _conn; _conn = SAServerSideConnection.Connection; SACommand cmd = _conn.CreateCommand(); cmd.CommandText = "CREATE TABLE Tab( c1 int, c2 char(128), c3 smallint, c4 double, c5 numeric(30,6) )"; cmd.ExecuteNonQuery(); cmd.Dispose();