I would like to write a program to create a page with a text/html module (with text and images).
I have insert query in the following tables
Dim addSQL As SqlCommand
Dim addTagSQL As SqlCommand
Dim addTagMSQL As SqlCommand
addTagSQL = New SqlCommand("insert into Tabs (TabOrder, PortalID, TabName, IsVisible, ParentID, Level, DisableLink, Title, IsDeleted, TabPath) values (3,0,'newsletter','true', 36,1,'False','Newsletter sent','False', '//Home//newsletter');select scope_identity()", DBConn)
Dim tab_id As Int32 = Convert.ToInt32(addTagSQL.ExecuteScalar())
Dim addModuleSQL As SqlCommand
addModuleSQL = New SqlCommand("insert into Modules (ModuleDefID, ModuleTitle, AllTabs, IsDeleted, InheritViewPermissions, PortalID) values (96, 'MLHTML', 'False', 'False', 'True', 0);select scope_identity()", DBConn)
Dim module_id As Int32 = Convert.ToInt32(addModuleSQL.ExecuteScalar())
addTagMSQL = New SqlCommand("insert into TabModules (TabID, ModuleID, PaneName, ModuleOrder, CacheTime, Visibility, DisplayTitle, DisplayPrint, DisplaySyndicate) values (" & tab_id & ", " & module_id & ", 'ContentPane', 1,0,0, 'True', 'True', 'False')", DBConn)
addTagMSQL.ExecuteScalar()
addSQL = New SqlCommand("insert into Apollo_MLHTML(ModuleID, Locale, DesktopHTML, CreatedByUser, CreatedDate) values (" & module_id & ", 'en-US', '" & Me.editor.Value & "', " & "1, '" & Date.Now.ToShortDateString & "')", DBConn)
addSQL.ExecuteScalar()
addSQL.Dispose()
DBConn.Dispose()
I can create a page with a module successfully. However, when i delete the page, it has errors and i checked the database, the records in tabs, tabsModule, Modules, apollo_mlhtml still exist. I would like to know if there are anything missing in the procedures?
Thank you