all groups > sql server replication > march 2005 >
You're in the

sql server replication

group:

SQLDMO and asp.net


SQLDMO and asp.net MSSQLServerDeveloper
3/14/2005 2:23:03 PM
sql server replication: I have this little piece of code that works in VB.NET but NOT in ASP.Net and
was wondering if anybody can help. In the part of the code that goes thru
each group in the server group to get all registered servers the code JUMPS
over it as if it doesn't see any. Also, if this helps, when I try to do a
connect, I get a sqlserver does not exist or access denied (DBNETLIB) error.
Here is the code, let me know your thoughts - tia /t

Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Data
Imports System.Data.SqlClient


Public Class WebForm1
Inherits Page

Dim dtservers As New DataTable
Private oApp As SQLDMO.Application
Private oGroup As SQLDMO.ServerGroup
Private oRServer As SQLDMO.RegisteredServer
Private oServer As SQLDMO.SQLServer
Private oDatabase As SQLDMO.Database


Protected WithEvents lbloutput As Label
Protected WithEvents cboServers As DropDownList

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

If Not IsPostBack Then
LoadServers()
End If
End Sub

Private Sub LoadServers()

oGroup = New SQLDMO.ServerGroup
oApp = New SQLDMO.Application

cboServers.Items.Clear()
For Each oGroup In oApp.ServerGroups
For Each oRServer In oGroup.RegisteredServers
cboServers.Items.Add(oRServer.Name)
Next oRServer
Next oGroup


End Sub
Re: SQLDMO and asp.net Ryan Walberg [MCSD]
3/18/2005 9:44:29 AM
[quoted text, click to view]

I believe the list of registered servers is dependent on the user that's
asking. Log in as the account that your ASP.NET application runs as and
AddThis Social Bookmark Button