I have a webpage that should display the database names from the master.sysdatabases in a dropdownlist.
The code for the stored procedure works fine in Query Analyzer and returns the list of all database names under that instance of SQL-Server 2000.
The code:
select name from master.dbo.sysdatabases
order by 1
doesn't return the sysdatabase names to the ASP.NET webpage when executing the stored procedure.
It returns:
System.Data.DataRowView
Why does it do this and how can I fix it?
Tx
I don't know what you are trying to do but the Master database and it's content are Microsoft Property, I don't think you can use them in your web application. If you look inside the Master or look at the System tables Poster you know using those tables in your application is not something you do. Hope this helps.|||Probably a permissions issue.|||Thanks.
The lookup is for our administrative/development purposes.
Since we have multiple databases to search through, the app shows the databases, you select a database, there's a lookup and display of tables, views and sprocs, and the contents are displayed in a large textbox for cutting and pasting purposes.
So the sysdatabases lookup is needed to select though the production databases.
The sproc doing the work has remote privs.
Other than that, how would you assign a priv to access the tables?
I didn't need it in QA.
Your help is appreciated.
|||I don't think it's a security/permissions issue. The built-in stored procedure sp_databases, which does exactly what your sql query does, has its execute permissions default to thepublic role. I think the problem is in your code, so you should post your code snippet here.|||A quick test is to run this in both the webpage and your QA and see the difference:
SELECT SUSER_NAME(),USER_NAME()
That will tell you who are logged into SQL Server as, and what login are you being mapped to.
Although, rereading your original message, herman is most likely correct. It appears that your .NET code is wrong, considering that system.whatever.dataview is a .NET class, I would say that you've assigned a dataview to a variable using the .ToString method, or have done so implicitly.