creating database and database tables programmatically(SQL-Server2

G

Guest

1) I assume there is a better way than good ol' ADOX or inline SQL in .NET
2.0 and SQL Server 2005 to create/delete databases and database tables and
get metadata about tables from .NET 2.0 code.
Which classes do I have to use?

2) Another frequent request on my list is dedecting all SQL-Server instances
local and in the network programmatically from .NET 2.0 code.

examples somewhere?

Thanky you! Herbert
 
W

William \(Bill\) Vaughn

My book covers both of these topics in great detail but alas it's still not
done.
1) Check out GetSchema on the Connection class. It's not hard to create the
SQL to create databases (assuming the backend supports it).
2) Check out the GetProvider factory classes. These return the providers
which can, in turn, return the instances.

I show off both of these techniques in my ADO.NET sessions and workshops. My
next is in Orlando in April.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top