A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.
I haven't used C# Express, but other versions of Visual Studio have a "Server Explorer" window that you can use to connect to the database server and create databases and tables. (accesible from the View menu)
You can also download SQL Express Manager, although I really didn't found it useful. Very useless tool IMO.
There is something stupid here, but it's not you.
Having spent a fair amount of time puzzling over this exact issue myself, I raised the question at the "ask the experts" booth at the VS2005/SQL Server 2005 roll out event in Seattle. The consensus was "hmmm... I guess you're right, you can't create tables in it." The best suggestion was to add a Database project to your solution, add a Sql Script document to the project (I may not have the correct names for the project and document type, this is from memory), type "CREATE TABLE foo ..." into the Sql document, and then right mouse-click on the document to run the Sql commands. (The first suggestion was to go to a DOS prompt and use osql, which I didn't really consider an acceptable answer in this day and age).
Doh. I got 3 hours sleep last night and spent 8 hours on the road today, which is why I just wrote a detailed answer to a question you didn't ask (sleep deprivation is an amazing thing... I was sure you asked how to create tables using the Database mgmt tool that ships with SqlExpress). Sorry about that.
Like the previous poster, I've just used VS2005 Pro and higher, so I'm afraid I can't answer the question you actually asked. Is there any sort of "Server browser" window that you can bring up?
And download SQL Express Manager. It's a combination of the old Enterprise Manager and Query Analyzer. It's... well, it kinda sucks, really, but it'll let you create tables and do queries and build sprocs and all that sort of stuff.
If you're a command line guy, use the "sqlcmd" command line app; this is the 2005 equivalent of the old "osql" program.
Oh, the other thing you'll need to know that I never found documented anywhere obvious, but is extremely important.
When connecting to the database, you need to specify the instance name, which is SQLEXPRESS.
So, in your connection string, use:
for the local machine, or:
for a server on another box.
Be aware that by default SQLExpress will only communicate on the same box; you'll need to explicitly enable network connections.
Using the OLEDB provider, you can connect to any datasource you want, as long as your connecting via code.
The fancy wizards and such will only connect to a local SQL Express install in the Express Editions of Visual Studio.
Eric D. Burdo
Wednesday, December 28, 2005
Thanks everybody. I specified SQLEXPRESS in the connect string (nothing else) and it worked fine. I'm glad that there's a command line interface, didn't know about it.
How do you set up the OLEDB functionality? I have an Oracle instance on the PC with the database, I'm looking into migrating it to SQL Server for price reasons.
Steve, do you know about OracleExpress database?
Free, and it works, and it can be installed in about 10 minutes. And setup is only one file, about 150Mb.
Thursday, December 29, 2005
Actually I am. I'd much rather work with Oracle because I already know Oracle (I've actually installed full instances on PC's many times) For the small number of users, I can't really justify Oracle's price for my client, so the effort to learn yet another &*^%&&*& tool.
If I can get this to work, then I will look into migrating it to real SQL Server.
This topic is archived. No further replies will be accepted.Other recent topics
Powered by FogBugz