need:
Microsoft.sqlServer.ConnectionInfo
Microsoft.SqlServer.Smo
Microsoft.SqlServer.SmoEnum
c#
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
private void ExecuteSqlfile(string sqlstring)
{
if (ConnectDatabase())
{
try
{
Server server = new Server(new ServerConnection(sqlConn));
server.ConnectionContext.ExecuteNonQuery(sqlstring);
}
finally
{
Command.Connection.Close();
}
}
}
Monday, April 27, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment