本文整理汇总了C#中SQLHandler.ExecuteScript方法的典型用法代码示例。如果您正苦于以下问题:C# SQLHandler.ExecuteScript方法的具体用法?C# SQLHandler.ExecuteScript怎么用?C# SQLHandler.ExecuteScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLHandler
的用法示例。
在下文中一共展示了SQLHandler.ExecuteScript方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteSql
//public static byte[] ConvertImageToByteArray(Stream afuInputStream, int contentLength)
//{
// byte[] sqlBinaryData = new byte[contentLength];
// afuInputStream.Read(sqlBinaryData, 0, contentLength);
// return sqlBinaryData;
//}
private void ExecuteSql()
{
try
{
SQLHandler objSqlh = new SQLHandler();
if (chkRunAsScript.Checked == true)
{
string strError = objSqlh.ExecuteScript(txtSqlQuery.Text);
if (string.IsNullOrEmpty(strError))
{
ShowMessage(SageMessageTitle.Information.ToString(), GetSageMessage("SQL", "TheQueryCompletedSuccessfully"), "", SageMessageType.Success);
}
else
{
ShowMessage(SageMessageTitle.Notification.ToString(), strError, "", SageMessageType.Alert);
}
}
else
{
System.Data.DataTable dt = objSqlh.ExecuteSQL(txtSqlQuery.Text);
if (dt != null)
{
gdvResults.DataSource = dt;
gdvResults.DataBind();
}
else
{
ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("SQL", "ThereIsAnErrorInYourQuery"), "", SageMessageType.Alert);
}
}
string txt = txtSqlQuery.Text;
}
catch (Exception ex)
{
ProcessException(ex);
}
}
示例2: RemoveSqlScript
public string RemoveSqlScript(string tempUnzippedPath, string sqlProvidername)
{
string exceptions = string.Empty;
try
{
var objReader = new StreamReader(tempUnzippedPath + '\\' + sqlProvidername);
string sLine = "";
string scriptDetails = "";
var arrText = new ArrayList();
while (sLine != null)
{
sLine = objReader.ReadLine();
if (sLine != null)
arrText.Add(sLine);
}
objReader.Close();
foreach (string sOutput in arrText)
{
scriptDetails += sOutput + "\r\n";
}
var sqlHandler = new SQLHandler();
exceptions = sqlHandler.ExecuteScript(scriptDetails, true);
}
catch (Exception ex)
{
exceptions += ex.Message.ToString();
}
return exceptions;
}
示例3: RegisterModule
public void RegisterModule(string moduleName, string moduleFolderPath, string procedure)
{
ModuleInfo objModule = new ModuleInfo();
int _newModuleID = 0;
int _newModuleDefID = 0;
int _newPortalmoduleID = 0;
string Exceptions = string.Empty;
string ExtensionMessage = string.Empty;
try
{
//add module and package tables
objModule.ModuleName = moduleName;
objModule.Name = moduleName;
objModule.FriendlyName = moduleName;
objModule.Description = txtModuleDescription.Text;
objModule.FolderName = moduleName;
objModule.Version = "01.00.00";//ddlFirst.SelectedValue + "." + ddlSecond.SelectedValue + "." + ddlLast.SelectedValue;//"01.00.00"; //new Version(1, 0, 0);
objModule.Owner = "";
objModule.Organization = "";
objModule.URL = "";
objModule.Email = "";
objModule.ReleaseNotes = "";
objModule.License = "";
objModule.PackageType = "Module";
objModule.isPremium = true;
objModule.supportedFeatures = 0;
objModule.BusinessControllerClass = "";
objModule.CompatibleVersions = "";
objModule.dependencies = "";
objModule.permissions = "";
ModuleController objController = new ModuleController();
int[] outputValue;
outputValue = objController.AddModules(objModule, false, 0, true, DateTime.Now, GetPortalID, GetUsername);
objModule.ModuleID = outputValue[0];
objModule.ModuleDefID = outputValue[1];
_newModuleID = objModule.ModuleID;
_newModuleDefID = objModule.ModuleDefID;
//insert into ProtalModule table
_newPortalmoduleID = objController.AddPortalModules(GetPortalID, _newModuleID, true, DateTime.Now, GetUsername);
//install permission for the installed module in ModuleDefPermission table with ModuleDefID and PermissionID
// get the default module VIEW permissions
int _permissionIDView = objController.GetPermissionByCodeAndKey("SYSTEM_VIEW", "VIEW");
objController.AddModulePermission(_newModuleDefID, _permissionIDView, GetPortalID, _newPortalmoduleID, true, GetUsername, true, DateTime.Now, GetUsername);
int _permissionIDEdit = objController.GetPermissionByCodeAndKey("SYSTEM_EDIT", "EDIT");
objController.AddModulePermission(_newModuleDefID, _permissionIDEdit, GetPortalID, _newPortalmoduleID, true, GetUsername, true, DateTime.Now, GetUsername);
RegisterControl(moduleName, moduleFolderPath + moduleName + "/" + moduleName + ".ascx", 1, _newModuleDefID);
if (chkEdit.Checked)
{
RegisterControl(moduleName, moduleFolderPath + moduleName + "/" + moduleName + "Edit" + ".ascx", 2, _newModuleDefID);
}
if (chkSetting.Checked)
{
RegisterControl(moduleName, moduleFolderPath + moduleName + "/" + moduleName + "Setting" + ".ascx", 3, _newModuleDefID);
}
if (Exceptions != string.Empty)
{
if (objModule.ModuleID > 0 && _newModuleDefID > 0)
{
Installers install = new Installers();
//Delete Module info from data base
install.ModulesRollBack(objModule.ModuleID, GetPortalID);
}
}
else
{
SQLHandler sageSQLHandler = new SQLHandler();
sageSQLHandler.ExecuteScript(procedure, true);
}
}
catch (Exception ex)
{
ShowMessage("", ex.ToString(), "", SageMessageType.Error);
ProcessException(ex);
}
Response.Redirect(Request.Url.AbsoluteUri);
}