|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
creating database and database tables programmatically(SQL-Server21) 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 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. -- Show quote____________________________________ 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. __________________________________ "herbert" <herb***@discussions.microsoft.com> wrote in message news:A613781D-60CB-44E1-AAAA-8DD197FB6A38@microsoft.com... > 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 |
|||||||||||||||||||||||