dbTalk Databases Forums  

SQL Server 2005 with VB.net 2005

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss SQL Server 2005 with VB.net 2005 in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: SQL Server 2005 with VB.net 2005 - 06-11-2007 , 03:04 AM






Omar Abid (omar.abid2006 (AT) gmail (DOT) com) writes:
Quote:
Thank u for the your reply and the links.
What I really want is too easy and clear :
I create a program that open SQL 2005 Data Bases and show tables of
the data base.
What I have done is to get a table data but I have to know the table
name before opening any one.
What I want is to know the tables name of the current data base.
Any idea ?
I just posted a sample on how to do it. You even reply to that post. Could
you care to explain why it does not address your problem?


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #12  
Old   
Omar Abid
 
Posts: n/a

Default Re: SQL Server 2005 with VB.net 2005 - 06-11-2007 , 03:26 AM






On 11 juin, 10:04, Erland Sommarskog <esq... (AT) sommarskog (DOT) se> wrote:
Quote:
Omar Abid (omar.abid2... (AT) gmail (DOT) com) writes:
Thank u for the your reply and the links.
What I really want is too easy and clear :
I create a program that open SQL 2005 Data Bases and show tables of
the data base.
What I have done is to get a table data but I have to know the table
name before opening any one.
What I want is to know the tables name of the current data base.
Any idea ?

I just posted a sample on how to do it. You even reply to that post. Could
you care to explain why it does not address your problem?

--
Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
I tried the code but I want any SQL Data Base and not Adventure Works



Reply With Quote
  #13  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: SQL Server 2005 with VB.net 2005 - 06-11-2007 , 04:30 PM



Omar Abid (omar.abid2006 (AT) gmail (DOT) com) writes:
Quote:
I tried the code but I want any SQL Data Base and not Adventure Works
Just replace AdventureWorks in the connection string with the database
of your choice. I used AdventureWorks to give you a working sample.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #14  
Old   
Piero 'Giops' Giorgi
 
Posts: n/a

Default Re: SQL Server 2005 with VB.net 2005 - 06-11-2007 , 06:33 PM



On 11 Giu, 14:30, Erland Sommarskog <esq... (AT) sommarskog (DOT) se> wrote:

Quote:
I tried the code but I want any SQL Data Base and not Adventure Works

Just replace AdventureWorks in the connection string with the database
of your choice. I used AdventureWorks to give you a working sample.
And just to be more specific...

' Connection string, change server and database!
strConn = "Application Name=systablesdemo;Integrated
Security=SSPI;"
strConn &= "Data Source=(local);Initial Catalog= ***** YOUR
DATABASE HERE **** "

P



Reply With Quote
  #15  
Old   
Omar Abid
 
Posts: n/a

Default Re: SQL Server 2005 with VB.net 2005 - 06-12-2007 , 01:54 AM



On 11 juin, 23:30, Erland Sommarskog <esq... (AT) sommarskog (DOT) se> wrote:
Quote:
Omar Abid (omar.abid2... (AT) gmail (DOT) com) writes:
I tried the code but I want any SQL Data Base and not Adventure Works

Just replace AdventureWorks in the connection string with the database
of your choice. I used AdventureWorks to give you a working sample.

--
Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Thank you the problem was solved, and I used mid to get the table
name, because the output was "[DBO].[table]"
Thanks again for your help
Omar Abid



Reply With Quote
  #16  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: SQL Server 2005 with VB.net 2005 - 06-12-2007 , 04:10 PM



Omar Abid (omar.abid2006 (AT) gmail (DOT) com) writes:
Quote:
Thank you the problem was solved, and I used mid to get the table
name, because the output was "[DBO].[table]"
You could modify the query if you don't want the schema.

Then again, in SQL 2005, it may be dangerous to ignore the schema, since
SQL 2005 makes schemas useful, and it can be deceivable to work with.
The AdventureWorks database is a good example of this.




--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #17  
Old   
Omar Abid
 
Posts: n/a

Default Re: SQL Server 2005 with VB.net 2005 - 06-12-2007 , 04:46 PM



On 12 juin, 23:10, Erland Sommarskog <esq... (AT) sommarskog (DOT) se> wrote:
Quote:
Omar Abid (omar.abid2... (AT) gmail (DOT) com) writes:
Thank you the problem was solved, and I used mid to get the table
name, because the output was "[DBO].[table]"

You could modify the query if you don't want the schema.

Then again, in SQL 2005, it may be dangerous to ignore the schema, since
SQL 2005 makes schemas useful, and it can be deceivable to work with.
The AdventureWorks database is a good example of this.

--
Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Thank you for your advice, it was really helpful to me
Omar Abid



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.