473,698 Members | 2,602 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connecting to MSSQL without a database

Hello,

I'm writing an application that should create a SQL Server 7 database
if it doens't exist.
i'm using the System.Data.Sql Client objects to connect and run queries.

My connection fails to the database because the database doesn't exist.

Can the connection string (ConnectionStri ng) be legal without refering
to a database?

Actually any good reference on how to create a SQL Server application
in CSharp that creates a database by itself would be great.
Also what the appropriate newsgroups to post this question to - in case
there are more relevant ones?

May 10 '06 #1
1 1258
When you don't have a database and need one tempdb is available to all valid
logins. To create a database you need to be in master.
May 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1718
by: bigoxygen | last post by:
Hi. I am experiencing problems connecting to MSSQL. I'm not sure where to begin looking for the problem. I don't know if the problem is originating with PHP or MSSQL What should the host name be? When I mouse over MSSQL manager it says "\\S-CIS-0042" $db_host='local'; //IP/host of the database server
3
2305
by: John Fabiani | last post by:
Hi, I'm hoping someone on the list has connected to sybase/MsSQL with something that works with DBAPI 2.0 from a linux box (SUSE 9.2) because I can't seem to get it done. I found Object Craft's python code that uses FreeTDS. But I can't get it compiled. The code is looking for "sybdb.h" (first error) - of course I don't have "sybdb.h". It is not in Object Crafts code nor in the FreeTDS source. I'm guessing that I need sybase develop...
4
4140
by: Leader | last post by:
Hi All, I have question and that is-- if i have a database that is implemented in MSDE Now i want the same database in MSSQL. What are the steps i do need to follow for this. Thanks in Advance Hoque
4
13305
by: BravesCharm | last post by:
I am trying to connect to SQL Server 2005 Express with Visual C# 2005 Express using this code: static void Main(string args) { SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\temp.MDF;User ID=MyUsername;password=MyPass;DATABASE=Test;Integrated Security=False;User Instance=True"); conn.Open();
9
5838
by: Advo | last post by:
Im having major problems trying to connect to a mssql database thats hosted on our server. I've got the ip, username, password and database name, yet no matter what i try, I cant seem to connect. I've trawled the net for hours looking for code, has anyone got any that definately works, or just a simple way I can check the connection. Thanks
1
1908
by: brosner | last post by:
I installed MSSQL 2000 on my desktop (running NT 2000). No problem. I created an adp and attached it to a database within MSSQL 2000, no problem. When I go into MS Access, on another PC (running Windows XP Pro) on the same network, and try to create a using 'Project(Existing Data)' and connect it to MSSQL 2000 on my desktop, I fill in the Data Link Properties '1. Select or enter server name', no problem, '2. I click on Use Windows NT...
1
13805
by: bg_ie | last post by:
Hi, I like to develope an application which uses a MsSQL database. I believe that C# works really well with MsSQL. To start with, I'd like to host the sql server locally on my machine as I develop, but later I'd like to be able to host it on a server and have multiple instances of the application access the server. I have installed SQL Server 2005 Express Edition on my machine but was never prompted for a user name or anything like...
0
1087
by: acb7621 | last post by:
Hi every1, Ive just created a database in MSSQL 2000. Ive created all the tables and inserted demo records it compiles completely. I am now trying to connect to the database with PHP through the IIS but it does not display anything at all. I have some normal 'echo' code to check that PHP is fine, and THAT displays ... but it seems i can't even connect but i don't even get an error message! I'm running PHP 5, IIS 5 and MSSQL 2000 on the...
6
1640
by: Joe Adams | last post by:
I am attempting to reinstall from a windows gone bad problem. XP had "died" and unable boot into os, so there was no backup or copy database made. Have installed new hdd. copied most all of the old hdd to a "backup" folder on new hdd. I know of the program files ms sql data subdir. System state. XP professional , not sharing on network, so is like standalone pc. sql is 8.0 ( the downloaded version that was part of the installation of a...
0
8680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9030
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7738
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.