VB.NET and Stored Procedures sp_Databases

Hello,

In our of our VB.NET form, we are using system stored procedure sp_databases to return list of databases. It works fine. Our SQL Server is 2000 and dedicated. This database list is shown in the combo box. It works fine.

Now in production environemtn user runs our EXE and connects to a dedicated SQL Server 2005. But he cannot see any database list in the combo box. Why? If user can connect to SQL Server 2005 and can perform table updates using other forms, why he does not see the database list on combo box? whereas if sp_databases is ruin directly from server, the list of database is shown.

Any idea?

Regards,
VJ
vj_miAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Are you getting an exceptions here?  

Bob
vj_miAuthor Commented:
No Bob ... no exceptions are shown ... rather it works very well on our SQL 2000.

Regards,
Vilas
Bob LearnedCommented:
Is this a simple connection and call to the database to get sp_Databases to execute?

Bob
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

vj_miAuthor Commented:
Yes ... a simple connection and then I call sp_databases and fill the return list of databases in combo box.

VJ
Bob LearnedCommented:
If you have a DataSet/DataTable, then you are saying the table.Rows.RecordCount = 0?  Did you check this?

Bob
vj_miAuthor Commented:
After calling the sp, I use the following:

sqlDT_DB = ds_DB.Tables(0)

For each dRow in sqlDT_DB.Rows
     'code to add item to combo box
Next

Regards,
Vilas
vj_miAuthor Commented:
This is becoming very urgent ... So I am increasing the points!

VJ
Bob LearnedCommented:
Have you met the permissions requirement?

  Requires CREATE DATABASE, or ALTER ANY DATABASE, or VIEW ANY DEFINITION permission, and must have access   permission to the database. Cannot be denied VIEW ANY DEFINITION permission.

Bob

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Éric MoreauSenior .Net ConsultantCommented:
have you tried to query the this view from the master database:
SELECT* FROM sys.databases
Bob LearnedCommented:
Schema: How do I list the databases on my server?
http://www.aspfaq.com/show.asp?id=2456

You can also use the system tables, but this is not the recommended approach, since system table functionality could change in a future version of SQL Server.

Bob
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.