• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 763
  • Last Modified:

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
0
vj_mi
Asked:
vj_mi
  • 5
  • 4
2 Solutions
 
Bob LearnedCommented:
Are you getting an exceptions here?  

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

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

Bob
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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

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

Bob
0
 
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
0
 
vj_miAuthor Commented:
This is becoming very urgent ... So I am increasing the points!

VJ
0
 
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
0
 
Éric MoreauSenior .Net ConsultantCommented:
have you tried to query the this view from the master database:
SELECT* FROM sys.databases
0
 
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now