I am trying to find a simple C# web script that will create a table on a SQL 2000 db.
Thanks,
Kevin C (major C# noob)
With SQL 2000 Server, creating different Database objects is much about dynamically creating and executing SQL Scripts on the Database Server. Here are 2 links that demonstrates how to use C# to create several Objects, starting with the DataBase itself:
http://www.c-sharpcorner.com/Code/2002/Mar/CreatingDBProgrammaticallyMCB.asp
http://www.codeproject.com/csharp/Schema.asp?print=true
The code in the article is from a .Net Windows Form project, but the interaction with the Database Server is basically identical in Asp.Net. Be aware that Asp.NET normally interacts with the Target servers (webserver, database server etc) through the '<machinename>\ASPNET' account. If your SQL Server is on another machine you will probably need to add log-in credentials for an account with necessary permissions to the generated SQL to succeed. Check back if you run into snags.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment