Can anybody help me/does anybody have the code to create a database on ms sql server 2000 using asp.net?
This needs to be done without being asked for the sql server login credentials (i.e the sa username/password can be inserted in the code)Using Microsoft Data Access Application Blocks, I would do the following (C#):
SQLHelper.ExecutNonQuery("Connection string", CommandType.Text, "Create Database...");
That's a simple brute force way to do it, you'll obviously need to play and tweak it, but hopefully that will get you started.
http://www.able-consulting.com/dotnet/adonet/Data_Providers.htm#SQLClientManagedProvider
is a link to where the connection strings for ADO.NET are.
HTH|||Thanks for the pointer.
Not being much of a .net coder, do you know of any complete solutions (web based database administration tools) or even better, do you know anybody that would be able to create the script for me...i'll pay of course!|||http://weblogs.asp.net/ashben/archive/2003/09/28/29469.aspx is a link to some web based datbase administration tools. Let us know if that is what you need or if you actually need someone to do this for you.|||Hi ericlandes,
Thanks for the link. I do still require someone to code an asp.net page for me to create databases.
* The page must be available to anonymous users (anyone can create a database) - So maybe the 'sa' user credentials are coded into the asp.net form?
* The form will allow the user to specify a database name to create and create an sql username/password with permissions to that database
* When the database is created, it will have certain options set (i.e maximum database size of 2mb)|||So will each person not only create the database, but create different fields, with different types, etc, or will each person basically generate a new 'template' database, all of them having the same fields/datatypes, with the only difference being the name of the database, it's username & password?|||The basic concept is:
User visits page, enters the name of the database they want to create, and also picks a username/password to create which will have access this new database.
Basic checks will need to be made to ensure that the database and username do not already exist.
The database will be created totaly blank, with the maximum size of the database set to 2mb|||anyone got any ideas?|||Hello xmsms,
It sounds to me like you are creating a web-hosting environment with data-access.
Even if this is not your intended useage, I'll bet that if you look for hosting tools for SQL-Server then you will be on the right track to finding the tool, or the right code for your needs.
Did you ever find your coder to do the job for you? If not and you are still stuck, I will be able to look into your question further after June 20th.
No comments:
Post a Comment