473,324 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How do I have SiteMap based on output of stored procedure?

How do I have a SiteMap based on the output of a stored procedure?

(I want to pass a @LanguageCode parameter to it so it will display the top
Menu in the appropriate language).

Aug 27 '08 #1
7 1580
http://msdn.microsoft.com/en-us/magazine/cc163657.aspx


"Mark B" <no*****@none.comwrote in message
news:OT**************@TK2MSFTNGP02.phx.gbl...
How do I have a SiteMap based on the output of a stored procedure?

(I want to pass a @LanguageCode parameter to it so it will display the top
Menu in the appropriate language).

Aug 27 '08 #2
You can set up resource files for the menu. It is much easier than creating
a custom site map provider, if all you want is different languages. If it
will not work for you, a custom site map provider is your best bet.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Mark B" <no*****@none.comwrote in message
news:OT**************@TK2MSFTNGP02.phx.gbl...
How do I have a SiteMap based on the output of a stored procedure?

(I want to pass a @LanguageCode parameter to it so it will display the top
Menu in the appropriate language).
Aug 28 '08 #3
Thanks. I am currently going through
http://msdn.microsoft.com/en-us/magazine/cc163657.aspx
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:uX**************@TK2MSFTNGP04.phx.gbl...
You can set up resource files for the menu. It is much easier than
creating a custom site map provider, if all you want is different
languages. If it will not work for you, a custom site map provider is your
best bet.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Mark B" <no*****@none.comwrote in message
news:OT**************@TK2MSFTNGP02.phx.gbl...
>How do I have a SiteMap based on the output of a stored procedure?

(I want to pass a @LanguageCode parameter to it so it will display the
top Menu in the appropriate language).
Aug 28 '08 #4
My site is written in VB.Net and
http://msdn.microsoft.com/en-us/magazine/cc163657.aspx is C# only.

So I used http://labs.developerfusion.co.uk/co...arp-to-vb.aspx to
convert it to VB.NET.

1) I am getting a compilation error though with the word OnSiteMapChanged
underlined below (can someone tell me why this is and what I'd need to do to
get a remedy?):

2) If that is remedied and I have updated my web.config, how do I actually
get a Menu Control on a page to use it as the Data source?

Compiler Error Message: BC32008:
'System.Web.Caching.CacheItemRemovedCallback' is a delegate type and
requires a single 'addressof' expression as the only argument to the
constructor.

Source Error:
Line 164: If dependency IsNot Nothing Then
Line 165:
HttpRuntime.Cache.Insert(_cacheDependencyName, New Object(), dependency,
Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration,
CacheItemPriority.NotRemovable, _
Line 166: New
CacheItemRemovedCallback(OnSiteMapChanged))
Line 167: End If
Line 168: End If
Here's the entire VB code ( the only compilation error is the one above):

Imports System
Imports System.Web
Imports System.Data.SqlClient
Imports System.Collections.Specialized
Imports System.Configuration
Imports System.Web.Configuration
Imports System.Collections.Generic
Imports System.Configuration.Provider
Imports System.Security.Permissions
Imports System.Data.Common
Imports System.Data
Imports System.Web.Caching

''' <summary>
''' Summary description for SqlSiteMapProvider
''' </summary>
<SqlClientPermission(SecurityAction.Demand, Unrestricted:=True)_
Public Class SqlSiteMapProvider
Inherits StaticSiteMapProvider
Private Const _errmsg1 As String = "Missing node ID"
Private Const _errmsg2 As String = "Duplicate node ID"
Private Const _errmsg3 As String = "Missing parent ID"
Private Const _errmsg4 As String = "Invalid parent ID"
Private Const _errmsg5 As String = "Empty or missing
connectionStringName"
Private Const _errmsg6 As String = "Missing connection string"
Private Const _errmsg7 As String = "Empty connection string"
Private Const _errmsg8 As String = "Invalid sqlCacheDependency"
Private Const _cacheDependencyName As String =
"__SiteMapCacheDependency"

Private _connect As String
' Database connection string
Private _database As String, _table As String
' Database info for SQL Server 7/2000 cache dependency
Private _2005dependency As Boolean = False
' Database info for SQL Server 2005 cache dependency
Private _indexID As Integer, _indexTitle As Integer, _indexUrl As
Integer, _indexDesc As Integer, _indexRoles As Integer, _indexParent As
Integer
Private _nodes As New Dictionary(Of Integer, SiteMapNode)(16)
Private ReadOnly _lock As New Object()
Private _root As SiteMapNode

Public Overloads Overrides Sub Initialize(ByVal name As String, ByVal
config As NameValueCollection)
' Verify that config isn't null
If config Is Nothing Then
Throw New ArgumentNullException("config")
End If

' Assign the provider a default name if it doesn't have one
If [String].IsNullOrEmpty(name) Then
name = "SqlSiteMapProvider"
End If

' Add a default "description" attribute to config if the
' attribute doesn't exist or is empty
If String.IsNullOrEmpty(config("description")) Then
config.Remove("description")
config.Add("description", "SQL site map provider")
End If

' Call the base class's Initialize method
MyBase.Initialize(name, config)

' Initialize _connect
Dim connect As String = config("connectionStringName")

If [String].IsNullOrEmpty(connect) Then
Throw New ProviderException(_errmsg5)
End If

config.Remove("connectionStringName")

If WebConfigurationManager.ConnectionStrings(connect) Is Nothing
Then
Throw New ProviderException(_errmsg6)
End If

_connect =
WebConfigurationManager.ConnectionStrings(connect) .ConnectionString

If [String].IsNullOrEmpty(_connect) Then
Throw New ProviderException(_errmsg7)
End If

' Initialize SQL cache dependency info
Dim dependency As String = config("sqlCacheDependency")

If Not [String].IsNullOrEmpty(dependency) Then
If [String].Equals(dependency, "CommandNotification",
StringComparison.InvariantCultureIgnoreCase) Then
SqlDependency.Start(_connect)
_2005dependency = True
Else
' If not "CommandNotification", then extract database and
table names
Dim info As String() = dependency.Split(New Char() {":"c})
If info.Length <2 Then
Throw New ProviderException(_errmsg8)
End If

_database = info(0)
_table = info(1)
End If

config.Remove("sqlCacheDependency")
End If

' SiteMapProvider processes the securityTrimmingEnabled
' attribute but fails to remove it. Remove it now so we can
' check for unrecognized configuration attributes.

If config("securityTrimmingEnabled") IsNot Nothing Then
config.Remove("securityTrimmingEnabled")
End If

' Throw an exception if unrecognized attributes remain
If config.Count 0 Then
Dim attr As String = config.GetKey(0)
If Not [String].IsNullOrEmpty(attr) Then
Throw New ProviderException("Unrecognized attribute: " +
attr)
End If
End If
End Sub

Public Overloads Overrides Function BuildSiteMap() As SiteMapNode
SyncLock _lock
' Return immediately if this method has been called before
If _root IsNot Nothing Then
Return _root
End If

' Query the database for site map nodes
Dim connection As New SqlConnection(_connect)

Try
Dim command As New SqlCommand("uspGeneralSiteMapGet",
connection)
command.CommandType = CommandType.StoredProcedure

' Create a SQL cache dependency if requested
Dim dependency As SqlCacheDependency = Nothing

If _2005dependency Then
dependency = New SqlCacheDependency(command)
ElseIf Not [String].IsNullOrEmpty(_database) AndAlso Not
String.IsNullOrEmpty(_table) Then
dependency = New SqlCacheDependency(_database, _table)
End If

connection.Open()
Dim reader As SqlDataReader = command.ExecuteReader()
_indexID = reader.GetOrdinal("ID")
_indexUrl = reader.GetOrdinal("Url")
_indexTitle = reader.GetOrdinal("Title")
_indexDesc = reader.GetOrdinal("Description")
_indexRoles = reader.GetOrdinal("Roles")
_indexParent = reader.GetOrdinal("Parent")

If reader.Read() Then
' Create the root SiteMapNode and add it to the site map
_root = CreateSiteMapNodeFromDataReader(reader)
AddNode(_root, Nothing)

' Build a tree of SiteMapNodes underneath the root node
While reader.Read()
' Create another site map node and add it to the
site map
Dim node As SiteMapNode =
CreateSiteMapNodeFromDataReader(reader)
AddNode(node, GetParentNodeFromDataReader(reader))
End While

' Use the SQL cache dependency
If dependency IsNot Nothing Then
HttpRuntime.Cache.Insert(_cacheDependencyName, New
Object(), dependency, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration,
CacheItemPriority.NotRemovable, _
New CacheItemRemovedCallback(OnSiteMapChanged))
End If
End If
Finally
connection.Close()
End Try

' Return the root SiteMapNode
Return _root
End SyncLock
End Function

Protected Overloads Overrides Function GetRootNodeCore() As SiteMapNode
SyncLock _lock
BuildSiteMap()
Return _root
End SyncLock
End Function

' Helper methods
Private Function CreateSiteMapNodeFromDataReader(ByVal reader As
DbDataReader) As SiteMapNode
' Make sure the node ID is present
If reader.IsDBNull(_indexID) Then
Throw New ProviderException(_errmsg1)
End If

' Get the node ID from the DataReader
Dim id As Integer = reader.GetInt32(_indexID)

' Make sure the node ID is unique
If _nodes.ContainsKey(id) Then
Throw New ProviderException(_errmsg2)
End If

' Get title, URL, description, and roles from the DataReader
Dim title As String = IIf(reader.IsDBNull(_indexTitle), Nothing,
reader.GetString(_indexTitle).Trim())
Dim url As String = IIf(reader.IsDBNull(_indexUrl), Nothing,
reader.GetString(_indexUrl).Trim())
Dim description As String = IIf(reader.IsDBNull(_indexDesc),
Nothing, reader.GetString(_indexDesc).Trim())
Dim roles As String = IIf(reader.IsDBNull(_indexRoles), Nothing,
reader.GetString(_indexRoles).Trim())

' If roles were specified, turn the list into a string array
Dim rolelist As String() = Nothing
If Not [String].IsNullOrEmpty(roles) Then
rolelist = roles.Split(New Char() {","c, ";"c}, 512)
End If

' Create a SiteMapNode
Dim node As New SiteMapNode(Me, id.ToString(), url, title,
description, rolelist, _
Nothing, Nothing, Nothing)

' Record the node in the _nodes dictionary
_nodes.Add(id, node)

' Return the node
Return node
End Function

Private Function GetParentNodeFromDataReader(ByVal reader As
DbDataReader) As SiteMapNode

' Make sure the parent ID is present
If reader.IsDBNull(_indexParent) Then
Throw New ProviderException(_errmsg3)
End If

' Get the parent ID from the DataReader
Dim pid As Integer = reader.GetInt32(_indexParent)

' Make sure the parent ID is valid
If Not _nodes.ContainsKey(pid) Then
Throw New ProviderException(_errmsg4)
End If

' Return the parent SiteMapNode
Return _nodes(pid)

End Function

Private Sub OnSiteMapChanged(ByVal key As String, ByVal item As Object,
ByVal reason As CacheItemRemovedReason)
SyncLock _lock
If key = _cacheDependencyName AndAlso reason =
CacheItemRemovedReason.DependencyChanged Then
' Refresh the site map
Clear()
_nodes.Clear()
_root = Nothing
End If
End SyncLock
End Sub
End Class




"Mark B" <no*****@none.comwrote in message
news:ec**************@TK2MSFTNGP02.phx.gbl...
Thanks. I am currently going through
http://msdn.microsoft.com/en-us/magazine/cc163657.aspx
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:uX**************@TK2MSFTNGP04.phx.gbl...
>You can set up resource files for the menu. It is much easier than
creating a custom site map provider, if all you want is different
languages. If it will not work for you, a custom site map provider is
your best bet.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Mark B" <no*****@none.comwrote in message
news:OT**************@TK2MSFTNGP02.phx.gbl...
>>How do I have a SiteMap based on the output of a stored procedure?

(I want to pass a @LanguageCode parameter to it so it will display the
top Menu in the appropriate language).
Aug 28 '08 #5
Google "VB.NET delegates"

Here is one:
http://www.quick-insure.com/cipl/delegates.htm

You just need to figure out the syntax differences for delegates between c#
and vb.net


"Mark B" <no*****@none.comwrote in message
news:u7**************@TK2MSFTNGP05.phx.gbl...
My site is written in VB.Net and
http://msdn.microsoft.com/en-us/magazine/cc163657.aspx is C# only.

So I used http://labs.developerfusion.co.uk/co...arp-to-vb.aspx to
convert it to VB.NET.

1) I am getting a compilation error though with the word OnSiteMapChanged
underlined below (can someone tell me why this is and what I'd need to do
to get a remedy?):

2) If that is remedied and I have updated my web.config, how do I actually
get a Menu Control on a page to use it as the Data source?

Compiler Error Message: BC32008:
'System.Web.Caching.CacheItemRemovedCallback' is a delegate type and
requires a single 'addressof' expression as the only argument to the
constructor.

Source Error:
Line 164: If dependency IsNot Nothing Then
Line 165: HttpRuntime.Cache.Insert(_cacheDependencyName, New Object(),
dependency, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration,
CacheItemPriority.NotRemovable, _
Line 166: New
CacheItemRemovedCallback(OnSiteMapChanged))
Line 167: End If
Line 168: End If
Here's the entire VB code ( the only compilation error is the one above):

Imports System
Imports System.Web
Imports System.Data.SqlClient
Imports System.Collections.Specialized
Imports System.Configuration
Imports System.Web.Configuration
Imports System.Collections.Generic
Imports System.Configuration.Provider
Imports System.Security.Permissions
Imports System.Data.Common
Imports System.Data
Imports System.Web.Caching

''' <summary>
''' Summary description for SqlSiteMapProvider
''' </summary>
<SqlClientPermission(SecurityAction.Demand, Unrestricted:=True)_
Public Class SqlSiteMapProvider
Inherits StaticSiteMapProvider
Private Const _errmsg1 As String = "Missing node ID"
Private Const _errmsg2 As String = "Duplicate node ID"
Private Const _errmsg3 As String = "Missing parent ID"
Private Const _errmsg4 As String = "Invalid parent ID"
Private Const _errmsg5 As String = "Empty or missing
connectionStringName"
Private Const _errmsg6 As String = "Missing connection string"
Private Const _errmsg7 As String = "Empty connection string"
Private Const _errmsg8 As String = "Invalid sqlCacheDependency"
Private Const _cacheDependencyName As String =
"__SiteMapCacheDependency"

Private _connect As String
' Database connection string
Private _database As String, _table As String
' Database info for SQL Server 7/2000 cache dependency
Private _2005dependency As Boolean = False
' Database info for SQL Server 2005 cache dependency
Private _indexID As Integer, _indexTitle As Integer, _indexUrl As
Integer, _indexDesc As Integer, _indexRoles As Integer, _indexParent As
Integer
Private _nodes As New Dictionary(Of Integer, SiteMapNode)(16)
Private ReadOnly _lock As New Object()
Private _root As SiteMapNode

Public Overloads Overrides Sub Initialize(ByVal name As String, ByVal
config As NameValueCollection)
' Verify that config isn't null
If config Is Nothing Then
Throw New ArgumentNullException("config")
End If

' Assign the provider a default name if it doesn't have one
If [String].IsNullOrEmpty(name) Then
name = "SqlSiteMapProvider"
End If

' Add a default "description" attribute to config if the
' attribute doesn't exist or is empty
If String.IsNullOrEmpty(config("description")) Then
config.Remove("description")
config.Add("description", "SQL site map provider")
End If

' Call the base class's Initialize method
MyBase.Initialize(name, config)

' Initialize _connect
Dim connect As String = config("connectionStringName")

If [String].IsNullOrEmpty(connect) Then
Throw New ProviderException(_errmsg5)
End If

config.Remove("connectionStringName")

If WebConfigurationManager.ConnectionStrings(connect) Is Nothing
Then
Throw New ProviderException(_errmsg6)
End If

_connect =
WebConfigurationManager.ConnectionStrings(connect) .ConnectionString

If [String].IsNullOrEmpty(_connect) Then
Throw New ProviderException(_errmsg7)
End If

' Initialize SQL cache dependency info
Dim dependency As String = config("sqlCacheDependency")

If Not [String].IsNullOrEmpty(dependency) Then
If [String].Equals(dependency, "CommandNotification",
StringComparison.InvariantCultureIgnoreCase) Then
SqlDependency.Start(_connect)
_2005dependency = True
Else
' If not "CommandNotification", then extract database and
table names
Dim info As String() = dependency.Split(New Char() {":"c})
If info.Length <2 Then
Throw New ProviderException(_errmsg8)
End If

_database = info(0)
_table = info(1)
End If

config.Remove("sqlCacheDependency")
End If

' SiteMapProvider processes the securityTrimmingEnabled
' attribute but fails to remove it. Remove it now so we can
' check for unrecognized configuration attributes.

If config("securityTrimmingEnabled") IsNot Nothing Then
config.Remove("securityTrimmingEnabled")
End If

' Throw an exception if unrecognized attributes remain
If config.Count 0 Then
Dim attr As String = config.GetKey(0)
If Not [String].IsNullOrEmpty(attr) Then
Throw New ProviderException("Unrecognized attribute: " +
attr)
End If
End If
End Sub

Public Overloads Overrides Function BuildSiteMap() As SiteMapNode
SyncLock _lock
' Return immediately if this method has been called before
If _root IsNot Nothing Then
Return _root
End If

' Query the database for site map nodes
Dim connection As New SqlConnection(_connect)

Try
Dim command As New SqlCommand("uspGeneralSiteMapGet",
connection)
command.CommandType = CommandType.StoredProcedure

' Create a SQL cache dependency if requested
Dim dependency As SqlCacheDependency = Nothing

If _2005dependency Then
dependency = New SqlCacheDependency(command)
ElseIf Not [String].IsNullOrEmpty(_database) AndAlso Not
String.IsNullOrEmpty(_table) Then
dependency = New SqlCacheDependency(_database, _table)
End If

connection.Open()
Dim reader As SqlDataReader = command.ExecuteReader()
_indexID = reader.GetOrdinal("ID")
_indexUrl = reader.GetOrdinal("Url")
_indexTitle = reader.GetOrdinal("Title")
_indexDesc = reader.GetOrdinal("Description")
_indexRoles = reader.GetOrdinal("Roles")
_indexParent = reader.GetOrdinal("Parent")

If reader.Read() Then
' Create the root SiteMapNode and add it to the site
map
_root = CreateSiteMapNodeFromDataReader(reader)
AddNode(_root, Nothing)

' Build a tree of SiteMapNodes underneath the root node
While reader.Read()
' Create another site map node and add it to the
site map
Dim node As SiteMapNode =
CreateSiteMapNodeFromDataReader(reader)
AddNode(node, GetParentNodeFromDataReader(reader))
End While

' Use the SQL cache dependency
If dependency IsNot Nothing Then
HttpRuntime.Cache.Insert(_cacheDependencyName, New
Object(), dependency, Cache.NoAbsoluteExpiration,
Cache.NoSlidingExpiration, CacheItemPriority.NotRemovable, _
New CacheItemRemovedCallback(OnSiteMapChanged))
End If
End If
Finally
connection.Close()
End Try

' Return the root SiteMapNode
Return _root
End SyncLock
End Function

Protected Overloads Overrides Function GetRootNodeCore() As SiteMapNode
SyncLock _lock
BuildSiteMap()
Return _root
End SyncLock
End Function

' Helper methods
Private Function CreateSiteMapNodeFromDataReader(ByVal reader As
DbDataReader) As SiteMapNode
' Make sure the node ID is present
If reader.IsDBNull(_indexID) Then
Throw New ProviderException(_errmsg1)
End If

' Get the node ID from the DataReader
Dim id As Integer = reader.GetInt32(_indexID)

' Make sure the node ID is unique
If _nodes.ContainsKey(id) Then
Throw New ProviderException(_errmsg2)
End If

' Get title, URL, description, and roles from the DataReader
Dim title As String = IIf(reader.IsDBNull(_indexTitle), Nothing,
reader.GetString(_indexTitle).Trim())
Dim url As String = IIf(reader.IsDBNull(_indexUrl), Nothing,
reader.GetString(_indexUrl).Trim())
Dim description As String = IIf(reader.IsDBNull(_indexDesc),
Nothing, reader.GetString(_indexDesc).Trim())
Dim roles As String = IIf(reader.IsDBNull(_indexRoles), Nothing,
reader.GetString(_indexRoles).Trim())

' If roles were specified, turn the list into a string array
Dim rolelist As String() = Nothing
If Not [String].IsNullOrEmpty(roles) Then
rolelist = roles.Split(New Char() {","c, ";"c}, 512)
End If

' Create a SiteMapNode
Dim node As New SiteMapNode(Me, id.ToString(), url, title,
description, rolelist, _
Nothing, Nothing, Nothing)

' Record the node in the _nodes dictionary
_nodes.Add(id, node)

' Return the node
Return node
End Function

Private Function GetParentNodeFromDataReader(ByVal reader As
DbDataReader) As SiteMapNode

' Make sure the parent ID is present
If reader.IsDBNull(_indexParent) Then
Throw New ProviderException(_errmsg3)
End If

' Get the parent ID from the DataReader
Dim pid As Integer = reader.GetInt32(_indexParent)

' Make sure the parent ID is valid
If Not _nodes.ContainsKey(pid) Then
Throw New ProviderException(_errmsg4)
End If

' Return the parent SiteMapNode
Return _nodes(pid)

End Function

Private Sub OnSiteMapChanged(ByVal key As String, ByVal item As Object,
ByVal reason As CacheItemRemovedReason)
SyncLock _lock
If key = _cacheDependencyName AndAlso reason =
CacheItemRemovedReason.DependencyChanged Then
' Refresh the site map
Clear()
_nodes.Clear()
_root = Nothing
End If
End SyncLock
End Sub
End Class




"Mark B" <no*****@none.comwrote in message
news:ec**************@TK2MSFTNGP02.phx.gbl...
>Thanks. I am currently going through
http://msdn.microsoft.com/en-us/magazine/cc163657.aspx
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:uX**************@TK2MSFTNGP04.phx.gbl...
>>You can set up resource files for the menu. It is much easier than
creating a custom site map provider, if all you want is different
languages. If it will not work for you, a custom site map provider is
your best bet.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Mark B" <no*****@none.comwrote in message
news:OT**************@TK2MSFTNGP02.phx.gbl...
How do I have a SiteMap based on the output of a stored procedure?

(I want to pass a @LanguageCode parameter to it so it will display the
top Menu in the appropriate language).

Aug 28 '08 #6
This is a delegate. I will have to look at the code, but you can probably
set up an event handler to handle the callback and be fine, as long as you
are sending the proper addressof for the event handler.

Sloan ping back is a good place to start. Understanding the delegate and
event structure of .NET will help a lot. You will also want to look at how
VB handles callbacks and sending in the callback procedure.

Another great tool for moving code from language to language is reflector.
It is now a Red Gate tool (http://www.red-gate.com/products/reflector/).
There is a free version. You will also want to download the file
dissassembler, which is a free add in (link on the page above).

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Mark B" <no*****@none.comwrote in message
news:u7**************@TK2MSFTNGP05.phx.gbl...
My site is written in VB.Net and
http://msdn.microsoft.com/en-us/magazine/cc163657.aspx is C# only.

So I used http://labs.developerfusion.co.uk/co...arp-to-vb.aspx to
convert it to VB.NET.

1) I am getting a compilation error though with the word OnSiteMapChanged
underlined below (can someone tell me why this is and what I'd need to do
to get a remedy?):

2) If that is remedied and I have updated my web.config, how do I actually
get a Menu Control on a page to use it as the Data source?

Compiler Error Message: BC32008:
'System.Web.Caching.CacheItemRemovedCallback' is a delegate type and
requires a single 'addressof' expression as the only argument to the
constructor.

Source Error:
Line 164: If dependency IsNot Nothing Then
Line 165: HttpRuntime.Cache.Insert(_cacheDependencyName, New Object(),
dependency, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration,
CacheItemPriority.NotRemovable, _
Line 166: New
CacheItemRemovedCallback(OnSiteMapChanged))
Line 167: End If
Line 168: End If
Here's the entire VB code ( the only compilation error is the one above):

Imports System
Imports System.Web
Imports System.Data.SqlClient
Imports System.Collections.Specialized
Imports System.Configuration
Imports System.Web.Configuration
Imports System.Collections.Generic
Imports System.Configuration.Provider
Imports System.Security.Permissions
Imports System.Data.Common
Imports System.Data
Imports System.Web.Caching

''' <summary>
''' Summary description for SqlSiteMapProvider
''' </summary>
<SqlClientPermission(SecurityAction.Demand, Unrestricted:=True)_
Public Class SqlSiteMapProvider
Inherits StaticSiteMapProvider
Private Const _errmsg1 As String = "Missing node ID"
Private Const _errmsg2 As String = "Duplicate node ID"
Private Const _errmsg3 As String = "Missing parent ID"
Private Const _errmsg4 As String = "Invalid parent ID"
Private Const _errmsg5 As String = "Empty or missing
connectionStringName"
Private Const _errmsg6 As String = "Missing connection string"
Private Const _errmsg7 As String = "Empty connection string"
Private Const _errmsg8 As String = "Invalid sqlCacheDependency"
Private Const _cacheDependencyName As String =
"__SiteMapCacheDependency"

Private _connect As String
' Database connection string
Private _database As String, _table As String
' Database info for SQL Server 7/2000 cache dependency
Private _2005dependency As Boolean = False
' Database info for SQL Server 2005 cache dependency
Private _indexID As Integer, _indexTitle As Integer, _indexUrl As
Integer, _indexDesc As Integer, _indexRoles As Integer, _indexParent As
Integer
Private _nodes As New Dictionary(Of Integer, SiteMapNode)(16)
Private ReadOnly _lock As New Object()
Private _root As SiteMapNode

Public Overloads Overrides Sub Initialize(ByVal name As String, ByVal
config As NameValueCollection)
' Verify that config isn't null
If config Is Nothing Then
Throw New ArgumentNullException("config")
End If

' Assign the provider a default name if it doesn't have one
If [String].IsNullOrEmpty(name) Then
name = "SqlSiteMapProvider"
End If

' Add a default "description" attribute to config if the
' attribute doesn't exist or is empty
If String.IsNullOrEmpty(config("description")) Then
config.Remove("description")
config.Add("description", "SQL site map provider")
End If

' Call the base class's Initialize method
MyBase.Initialize(name, config)

' Initialize _connect
Dim connect As String = config("connectionStringName")

If [String].IsNullOrEmpty(connect) Then
Throw New ProviderException(_errmsg5)
End If

config.Remove("connectionStringName")

If WebConfigurationManager.ConnectionStrings(connect) Is Nothing
Then
Throw New ProviderException(_errmsg6)
End If

_connect =
WebConfigurationManager.ConnectionStrings(connect) .ConnectionString

If [String].IsNullOrEmpty(_connect) Then
Throw New ProviderException(_errmsg7)
End If

' Initialize SQL cache dependency info
Dim dependency As String = config("sqlCacheDependency")

If Not [String].IsNullOrEmpty(dependency) Then
If [String].Equals(dependency, "CommandNotification",
StringComparison.InvariantCultureIgnoreCase) Then
SqlDependency.Start(_connect)
_2005dependency = True
Else
' If not "CommandNotification", then extract database and
table names
Dim info As String() = dependency.Split(New Char() {":"c})
If info.Length <2 Then
Throw New ProviderException(_errmsg8)
End If

_database = info(0)
_table = info(1)
End If

config.Remove("sqlCacheDependency")
End If

' SiteMapProvider processes the securityTrimmingEnabled
' attribute but fails to remove it. Remove it now so we can
' check for unrecognized configuration attributes.

If config("securityTrimmingEnabled") IsNot Nothing Then
config.Remove("securityTrimmingEnabled")
End If

' Throw an exception if unrecognized attributes remain
If config.Count 0 Then
Dim attr As String = config.GetKey(0)
If Not [String].IsNullOrEmpty(attr) Then
Throw New ProviderException("Unrecognized attribute: " +
attr)
End If
End If
End Sub

Public Overloads Overrides Function BuildSiteMap() As SiteMapNode
SyncLock _lock
' Return immediately if this method has been called before
If _root IsNot Nothing Then
Return _root
End If

' Query the database for site map nodes
Dim connection As New SqlConnection(_connect)

Try
Dim command As New SqlCommand("uspGeneralSiteMapGet",
connection)
command.CommandType = CommandType.StoredProcedure

' Create a SQL cache dependency if requested
Dim dependency As SqlCacheDependency = Nothing

If _2005dependency Then
dependency = New SqlCacheDependency(command)
ElseIf Not [String].IsNullOrEmpty(_database) AndAlso Not
String.IsNullOrEmpty(_table) Then
dependency = New SqlCacheDependency(_database, _table)
End If

connection.Open()
Dim reader As SqlDataReader = command.ExecuteReader()
_indexID = reader.GetOrdinal("ID")
_indexUrl = reader.GetOrdinal("Url")
_indexTitle = reader.GetOrdinal("Title")
_indexDesc = reader.GetOrdinal("Description")
_indexRoles = reader.GetOrdinal("Roles")
_indexParent = reader.GetOrdinal("Parent")

If reader.Read() Then
' Create the root SiteMapNode and add it to the site
map
_root = CreateSiteMapNodeFromDataReader(reader)
AddNode(_root, Nothing)

' Build a tree of SiteMapNodes underneath the root node
While reader.Read()
' Create another site map node and add it to the
site map
Dim node As SiteMapNode =
CreateSiteMapNodeFromDataReader(reader)
AddNode(node, GetParentNodeFromDataReader(reader))
End While

' Use the SQL cache dependency
If dependency IsNot Nothing Then
HttpRuntime.Cache.Insert(_cacheDependencyName, New
Object(), dependency, Cache.NoAbsoluteExpiration,
Cache.NoSlidingExpiration, CacheItemPriority.NotRemovable, _
New CacheItemRemovedCallback(OnSiteMapChanged))
End If
End If
Finally
connection.Close()
End Try

' Return the root SiteMapNode
Return _root
End SyncLock
End Function

Protected Overloads Overrides Function GetRootNodeCore() As SiteMapNode
SyncLock _lock
BuildSiteMap()
Return _root
End SyncLock
End Function

' Helper methods
Private Function CreateSiteMapNodeFromDataReader(ByVal reader As
DbDataReader) As SiteMapNode
' Make sure the node ID is present
If reader.IsDBNull(_indexID) Then
Throw New ProviderException(_errmsg1)
End If

' Get the node ID from the DataReader
Dim id As Integer = reader.GetInt32(_indexID)

' Make sure the node ID is unique
If _nodes.ContainsKey(id) Then
Throw New ProviderException(_errmsg2)
End If

' Get title, URL, description, and roles from the DataReader
Dim title As String = IIf(reader.IsDBNull(_indexTitle), Nothing,
reader.GetString(_indexTitle).Trim())
Dim url As String = IIf(reader.IsDBNull(_indexUrl), Nothing,
reader.GetString(_indexUrl).Trim())
Dim description As String = IIf(reader.IsDBNull(_indexDesc),
Nothing, reader.GetString(_indexDesc).Trim())
Dim roles As String = IIf(reader.IsDBNull(_indexRoles), Nothing,
reader.GetString(_indexRoles).Trim())

' If roles were specified, turn the list into a string array
Dim rolelist As String() = Nothing
If Not [String].IsNullOrEmpty(roles) Then
rolelist = roles.Split(New Char() {","c, ";"c}, 512)
End If

' Create a SiteMapNode
Dim node As New SiteMapNode(Me, id.ToString(), url, title,
description, rolelist, _
Nothing, Nothing, Nothing)

' Record the node in the _nodes dictionary
_nodes.Add(id, node)

' Return the node
Return node
End Function

Private Function GetParentNodeFromDataReader(ByVal reader As
DbDataReader) As SiteMapNode

' Make sure the parent ID is present
If reader.IsDBNull(_indexParent) Then
Throw New ProviderException(_errmsg3)
End If

' Get the parent ID from the DataReader
Dim pid As Integer = reader.GetInt32(_indexParent)

' Make sure the parent ID is valid
If Not _nodes.ContainsKey(pid) Then
Throw New ProviderException(_errmsg4)
End If

' Return the parent SiteMapNode
Return _nodes(pid)

End Function

Private Sub OnSiteMapChanged(ByVal key As String, ByVal item As Object,
ByVal reason As CacheItemRemovedReason)
SyncLock _lock
If key = _cacheDependencyName AndAlso reason =
CacheItemRemovedReason.DependencyChanged Then
' Refresh the site map
Clear()
_nodes.Clear()
_root = Nothing
End If
End SyncLock
End Sub
End Class




"Mark B" <no*****@none.comwrote in message
news:ec**************@TK2MSFTNGP02.phx.gbl...
>Thanks. I am currently going through
http://msdn.microsoft.com/en-us/magazine/cc163657.aspx
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:uX**************@TK2MSFTNGP04.phx.gbl...
>>You can set up resource files for the menu. It is much easier than
creating a custom site map provider, if all you want is different
languages. If it will not work for you, a custom site map provider is
your best bet.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Mark B" <no*****@none.comwrote in message
news:OT**************@TK2MSFTNGP02.phx.gbl...
How do I have a SiteMap based on the output of a stored procedure?

(I want to pass a @LanguageCode parameter to it so it will display the
top Menu in the appropriate language).
Sep 2 '08 #7
Thanks. I got our C# programmer to have a look at the code. He got it
working by simply putting the word AddressOf in front of it:

' Use the SQL cache dependency
If dependency IsNot Nothing Then
HttpRuntime.Cache.Insert(_cacheDependencyName, New
Object(), dependency, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration,
CacheItemPriority.NotRemovable, _
New CacheItemRemovedCallback(AddressOf
OnSiteMapChanged))
End If
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:%2******************@TK2MSFTNGP06.phx.gbl...
This is a delegate. I will have to look at the code, but you can probably
set up an event handler to handle the callback and be fine, as long as you
are sending the proper addressof for the event handler.

Sloan ping back is a good place to start. Understanding the delegate and
event structure of .NET will help a lot. You will also want to look at how
VB handles callbacks and sending in the callback procedure.

Another great tool for moving code from language to language is reflector.
It is now a Red Gate tool (http://www.red-gate.com/products/reflector/).
There is a free version. You will also want to download the file
dissassembler, which is a free add in (link on the page above).

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Mark B" <no*****@none.comwrote in message
news:u7**************@TK2MSFTNGP05.phx.gbl...
>My site is written in VB.Net and
http://msdn.microsoft.com/en-us/magazine/cc163657.aspx is C# only.

So I used http://labs.developerfusion.co.uk/co...arp-to-vb.aspx to
convert it to VB.NET.

1) I am getting a compilation error though with the word OnSiteMapChanged
underlined below (can someone tell me why this is and what I'd need to do
to get a remedy?):

2) If that is remedied and I have updated my web.config, how do I
actually get a Menu Control on a page to use it as the Data source?

Compiler Error Message: BC32008:
'System.Web.Caching.CacheItemRemovedCallback' is a delegate type and
requires a single 'addressof' expression as the only argument to the
constructor.

Source Error:
Line 164: If dependency IsNot Nothing Then
Line 165: HttpRuntime.Cache.Insert(_cacheDependencyName, New Object(),
dependency, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration,
CacheItemPriority.NotRemovable, _
Line 166: New
CacheItemRemovedCallback(OnSiteMapChanged))
Line 167: End If
Line 168: End If
Here's the entire VB code ( the only compilation error is the one above):

Imports System
Imports System.Web
Imports System.Data.SqlClient
Imports System.Collections.Specialized
Imports System.Configuration
Imports System.Web.Configuration
Imports System.Collections.Generic
Imports System.Configuration.Provider
Imports System.Security.Permissions
Imports System.Data.Common
Imports System.Data
Imports System.Web.Caching

''' <summary>
''' Summary description for SqlSiteMapProvider
''' </summary>
<SqlClientPermission(SecurityAction.Demand, Unrestricted:=True)_
Public Class SqlSiteMapProvider
Inherits StaticSiteMapProvider
Private Const _errmsg1 As String = "Missing node ID"
Private Const _errmsg2 As String = "Duplicate node ID"
Private Const _errmsg3 As String = "Missing parent ID"
Private Const _errmsg4 As String = "Invalid parent ID"
Private Const _errmsg5 As String = "Empty or missing
connectionStringName"
Private Const _errmsg6 As String = "Missing connection string"
Private Const _errmsg7 As String = "Empty connection string"
Private Const _errmsg8 As String = "Invalid sqlCacheDependency"
Private Const _cacheDependencyName As String =
"__SiteMapCacheDependency"

Private _connect As String
' Database connection string
Private _database As String, _table As String
' Database info for SQL Server 7/2000 cache dependency
Private _2005dependency As Boolean = False
' Database info for SQL Server 2005 cache dependency
Private _indexID As Integer, _indexTitle As Integer, _indexUrl As
Integer, _indexDesc As Integer, _indexRoles As Integer, _indexParent As
Integer
Private _nodes As New Dictionary(Of Integer, SiteMapNode)(16)
Private ReadOnly _lock As New Object()
Private _root As SiteMapNode

Public Overloads Overrides Sub Initialize(ByVal name As String, ByVal
config As NameValueCollection)
' Verify that config isn't null
If config Is Nothing Then
Throw New ArgumentNullException("config")
End If

' Assign the provider a default name if it doesn't have one
If [String].IsNullOrEmpty(name) Then
name = "SqlSiteMapProvider"
End If

' Add a default "description" attribute to config if the
' attribute doesn't exist or is empty
If String.IsNullOrEmpty(config("description")) Then
config.Remove("description")
config.Add("description", "SQL site map provider")
End If

' Call the base class's Initialize method
MyBase.Initialize(name, config)

' Initialize _connect
Dim connect As String = config("connectionStringName")

If [String].IsNullOrEmpty(connect) Then
Throw New ProviderException(_errmsg5)
End If

config.Remove("connectionStringName")

If WebConfigurationManager.ConnectionStrings(connect) Is Nothing
Then
Throw New ProviderException(_errmsg6)
End If

_connect =
WebConfigurationManager.ConnectionStrings(connect ).ConnectionString

If [String].IsNullOrEmpty(_connect) Then
Throw New ProviderException(_errmsg7)
End If

' Initialize SQL cache dependency info
Dim dependency As String = config("sqlCacheDependency")

If Not [String].IsNullOrEmpty(dependency) Then
If [String].Equals(dependency, "CommandNotification",
StringComparison.InvariantCultureIgnoreCase) Then
SqlDependency.Start(_connect)
_2005dependency = True
Else
' If not "CommandNotification", then extract database and
table names
Dim info As String() = dependency.Split(New Char() {":"c})
If info.Length <2 Then
Throw New ProviderException(_errmsg8)
End If

_database = info(0)
_table = info(1)
End If

config.Remove("sqlCacheDependency")
End If

' SiteMapProvider processes the securityTrimmingEnabled
' attribute but fails to remove it. Remove it now so we can
' check for unrecognized configuration attributes.

If config("securityTrimmingEnabled") IsNot Nothing Then
config.Remove("securityTrimmingEnabled")
End If

' Throw an exception if unrecognized attributes remain
If config.Count 0 Then
Dim attr As String = config.GetKey(0)
If Not [String].IsNullOrEmpty(attr) Then
Throw New ProviderException("Unrecognized attribute: " +
attr)
End If
End If
End Sub

Public Overloads Overrides Function BuildSiteMap() As SiteMapNode
SyncLock _lock
' Return immediately if this method has been called before
If _root IsNot Nothing Then
Return _root
End If

' Query the database for site map nodes
Dim connection As New SqlConnection(_connect)

Try
Dim command As New SqlCommand("uspGeneralSiteMapGet",
connection)
command.CommandType = CommandType.StoredProcedure

' Create a SQL cache dependency if requested
Dim dependency As SqlCacheDependency = Nothing

If _2005dependency Then
dependency = New SqlCacheDependency(command)
ElseIf Not [String].IsNullOrEmpty(_database) AndAlso Not
String.IsNullOrEmpty(_table) Then
dependency = New SqlCacheDependency(_database, _table)
End If

connection.Open()
Dim reader As SqlDataReader = command.ExecuteReader()
_indexID = reader.GetOrdinal("ID")
_indexUrl = reader.GetOrdinal("Url")
_indexTitle = reader.GetOrdinal("Title")
_indexDesc = reader.GetOrdinal("Description")
_indexRoles = reader.GetOrdinal("Roles")
_indexParent = reader.GetOrdinal("Parent")

If reader.Read() Then
' Create the root SiteMapNode and add it to the site
map
_root = CreateSiteMapNodeFromDataReader(reader)
AddNode(_root, Nothing)

' Build a tree of SiteMapNodes underneath the root
node
While reader.Read()
' Create another site map node and add it to the
site map
Dim node As SiteMapNode =
CreateSiteMapNodeFromDataReader(reader)
AddNode(node, GetParentNodeFromDataReader(reader))
End While

' Use the SQL cache dependency
If dependency IsNot Nothing Then
HttpRuntime.Cache.Insert(_cacheDependencyName, New
Object(), dependency, Cache.NoAbsoluteExpiration,
Cache.NoSlidingExpiration, CacheItemPriority.NotRemovable, _
New CacheItemRemovedCallback(OnSiteMapChanged))
End If
End If
Finally
connection.Close()
End Try

' Return the root SiteMapNode
Return _root
End SyncLock
End Function

Protected Overloads Overrides Function GetRootNodeCore() As
SiteMapNode
SyncLock _lock
BuildSiteMap()
Return _root
End SyncLock
End Function

' Helper methods
Private Function CreateSiteMapNodeFromDataReader(ByVal reader As
DbDataReader) As SiteMapNode
' Make sure the node ID is present
If reader.IsDBNull(_indexID) Then
Throw New ProviderException(_errmsg1)
End If

' Get the node ID from the DataReader
Dim id As Integer = reader.GetInt32(_indexID)

' Make sure the node ID is unique
If _nodes.ContainsKey(id) Then
Throw New ProviderException(_errmsg2)
End If

' Get title, URL, description, and roles from the DataReader
Dim title As String = IIf(reader.IsDBNull(_indexTitle), Nothing,
reader.GetString(_indexTitle).Trim())
Dim url As String = IIf(reader.IsDBNull(_indexUrl), Nothing,
reader.GetString(_indexUrl).Trim())
Dim description As String = IIf(reader.IsDBNull(_indexDesc),
Nothing, reader.GetString(_indexDesc).Trim())
Dim roles As String = IIf(reader.IsDBNull(_indexRoles), Nothing,
reader.GetString(_indexRoles).Trim())

' If roles were specified, turn the list into a string array
Dim rolelist As String() = Nothing
If Not [String].IsNullOrEmpty(roles) Then
rolelist = roles.Split(New Char() {","c, ";"c}, 512)
End If

' Create a SiteMapNode
Dim node As New SiteMapNode(Me, id.ToString(), url, title,
description, rolelist, _
Nothing, Nothing, Nothing)

' Record the node in the _nodes dictionary
_nodes.Add(id, node)

' Return the node
Return node
End Function

Private Function GetParentNodeFromDataReader(ByVal reader As
DbDataReader) As SiteMapNode

' Make sure the parent ID is present
If reader.IsDBNull(_indexParent) Then
Throw New ProviderException(_errmsg3)
End If

' Get the parent ID from the DataReader
Dim pid As Integer = reader.GetInt32(_indexParent)

' Make sure the parent ID is valid
If Not _nodes.ContainsKey(pid) Then
Throw New ProviderException(_errmsg4)
End If

' Return the parent SiteMapNode
Return _nodes(pid)

End Function

Private Sub OnSiteMapChanged(ByVal key As String, ByVal item As
Object, ByVal reason As CacheItemRemovedReason)
SyncLock _lock
If key = _cacheDependencyName AndAlso reason =
CacheItemRemovedReason.DependencyChanged Then
' Refresh the site map
Clear()
_nodes.Clear()
_root = Nothing
End If
End SyncLock
End Sub
End Class




"Mark B" <no*****@none.comwrote in message
news:ec**************@TK2MSFTNGP02.phx.gbl...
>>Thanks. I am currently going through
http://msdn.microsoft.com/en-us/magazine/cc163657.aspx
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote
in message news:uX**************@TK2MSFTNGP04.phx.gbl...
You can set up resource files for the menu. It is much easier than
creating a custom site map provider, if all you want is different
languages. If it will not work for you, a custom site map provider is
your best bet.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Mark B" <no*****@none.comwrote in message
news:OT**************@TK2MSFTNGP02.phx.gbl...
How do I have a SiteMap based on the output of a stored procedure?
>
(I want to pass a @LanguageCode parameter to it so it will display the
top Menu in the appropriate language).

Sep 2 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steve Holden | last post by:
Has anyone, with any driver whatsoever, managed to retrieve output parameters from a SQL Server stored procedure? I've just been rather embarrassed to find out it's not as easy as it might seem,...
4
by: Greg | last post by:
I need to send the result of a procedure to an update statement. Basically updating the column of one table with the result of a query in a stored procedure. It only returns one value, if it didnt...
7
by: Philip Mette | last post by:
Does anyone have any good references they could recommend on Cursor based SQL writing? I have to create SQL that can loop though records simular to VB loops and I have been told that this is the...
5
by: MS | last post by:
Here's my simple stored procedure: ALTER PROCEDURE GetMemberIDByEmail @Email EmailAddress, @ID int OUTPUT AS SELECT @ID = ID FROM tbl_Member WHERE Email=@Email RETURN
4
by: Mr Not So Know It All | last post by:
im new to SQL Server and ASP.Net. Here's my problem. I have this SQL Server stored procedure with an input parameter and output parameter CREATE PROCEDURE . @in_rc varchar(8) @out_eList...
13
by: JayCallas | last post by:
I know this question has been asked. And the usual answer is don't use cursors or any other looping method. Instead, try to find a solution that uses set-based queries. But this brings up...
5
by: JJ | last post by:
Although this question involves Flash, I suspect the actual issue is an asp one.. I am trying to open the web.sitemap file in an .swf file enbedded in an asp page (I'm working in VS 2005). I...
5
by: Tim Mackey | last post by:
hi, i have put my web.sitemap in /App_Data so i can edit it programatically via a web admin page, inheriting the modify permissions from the App_Data folder etc. i was hoping the provider would...
6
by: Olagato | last post by:
I need to transform this: <urlset xmlns="http://www.google.com/schemas/sitemap/0.84"> <url> <loc>http://localhost/index.php/index./Paths-for-the-extreme-player</ loc> </url> <url>...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.