473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

CREATE DATABASE not working from within .net 2010

228 100+
I generated SQL Server 2008 Database scripts. There are total 80 objects. The script executes successfully from sql server query. But not from .NET. That is I want to create the objects (tables and stored procedures) from there.

If the database don't exist already in sql server, it fails. I have included the line

Expand|Select|Wrap|Line Numbers
  1. IF NOT EXIST (DATABASE)...
  2.  
  3. CREATE DATABASE DBNAME
  4.  
But it simply don't work and the process fails while the code perfectly works directly in SQL Server.

Any work around this? Can I run CREATE DATABASE somehow?
Feb 14 '12 #1
1 1283
MrMancunian
569 Expert 512MB
You can, but you need to make sure that the credentials you use to access your SQL Server via Visual Studio also have rights to create a database.
Feb 15 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: lynn | last post by:
Hello everybody, I am having difficulties: I am working on Mac OSX 10.2.8 with mysql 4. I needed to change the data directory of MySQL from its original place (where the application have to be...
2
by: Robin Tucker | last post by:
I have some code that dynamically creates a database (name is @FullName) and then creates a table within that database. Is it possible to wrap these things into a transaction such that if any one...
1
by: Jeremy Holt | last post by:
I have an Installer Setup project which builds fine. However, if I select Install from within the solution, the installation fails with a message "The installer was interruped before XXXXX could be...
5
by: Frank van Vugt | last post by:
Hi, I noticed that when using the single commandline: drop database <name>; create database <name>; this sometimes fails due to a pg_autovacuum process running on the background. When...
3
by: C | last post by:
Re: Microsoft Knowledge Base Article - 870669 How to disable the ADODB.Stream object from Internet Explorer You may recently have heard of the vulnarability exposed by Internet Explorer as...
1
by: J. Shrimp, Jr. | last post by:
Have to call up a 2nd database from within the first. Can open the 2nd database no problem, but when the user is done with the 2nd database and closes the form, or exits the 2nd database, how can...
4
by: Nanda | last post by:
hi, how to create database in mssql server using c#. We can create msacess database using adox, similiarly how to create sql server database using c#. Regards, Nanda.
2
by: Jim | last post by:
Could someone explain briefly or point in a good direction. Am I able to build a database using vb.net 2003 without having to already have a sql or access database to connect too. I cannot seem...
7
by: Martin | last post by:
Hello Does anyone know if it is possible to use the smo db.Create() method to create a new sql server database with sql server 2005 express? The debugger complains that remote operations are not...
1
by: Sue | last post by:
I just installed the free DB2 Express. I am going through the wizard and I am unable to create a database. I keep getting the error "create database path does not exist". The log file says "An...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.