Skip to main content

Posts

Showing posts from July, 2009

Check if a table exist using EntitySpaces in DotNetNuke

Using esUtility ExecuteScalar method the function(VB.Net) below given the table name will return true if the table exist in the database otherwise it will return false. Public Shared Function TableExist(ByVal tableName As String) As Boolean Dim strSQL As String = "SELECT Count(*) FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwner}[{objectQualifier}" & tableName & "]') AND OBJECTPROPERTY(id, N'IsTable') = 1" strSQL = strSQL.Replace("{databaseOwner}", DotNetNuke.Common.Utilities.Config.GetDataBaseOwner()) strSQL = strSQL.Replace("{objectQualifier}", DotNetNuke.Common.Utilities.Config.GetObjectQualifer()) Dim util As New esUtility() If util.ExecuteScalar(esQueryType.Text, strsql) > 0 Then Return True Else Return False End If End Function

Make sure your Javascripts are in the proper location in DotNetNuke

Calling the procedure below in your DotNetNuke module will make sure that your client script will be inserted in the proper place. Which is inside the Head tag. The Code: view source print ? 01. Public Sub InjectClientScript( ByVal page As System.Web.UI.Page, ByVal scriptKey As String , ByVal scriptSrc As String , Optional ByVal scriptValue As String = "" ) 02.     Dim objHead As Control = page.FindControl( "Head" ) 03.     If objHead IsNot Nothing Then 04.         If objHead.FindControl(scriptKey) Is Nothing Then 05.             Dim jQueryControl As New HtmlGenericControl( "script" ) 06.             jQueryControl.ID = scriptKey 07.          ...