hi, I install DataObjects.Net v4.0 by runnig DataObjects.Net-v4.1.0.168-Installer.exe, when I run asp.net sample, I found that there is no installed database on SQL server and I got error. how can I attached required database to SQL Server ?

This thread was imported from our support forum. The original discussion may contain more detailed answer. Original topic by emad.

asked Jan 01 '10 at 21:15

Editor's gravatar image

Editor
46156156157


One Answer:

Hmm... There is really a lack in Manual - we didn't describe that databases must be created. Basically, you need just create an empty "DO40-Tests" database.

You can create it e.g. by executing the following script:

SET NOCOUNT ON
GO

USE master
GO
if exists (select * from sysdatabases where name='DO40-Tests')
  drop database [DO40-Tests]
go

DECLARE @device_directory NVARCHAR(520)
SELECT @device_directory = SUBSTRING(filename, 1, CHARINDEX(N'master.mdf', LOWER(filename)) - 1)
FROM master.dbo.sysaltfiles WHERE dbid = 1 AND fileid = 1

EXECUTE (N'CREATE DATABASE [DO40-Tests]
  ON PRIMARY (NAME = N''DO40-Tests'', FILENAME = N''' + @device_directory + N'DO40-Tests.mdf'')
  LOG ON (NAME = N''DO40-Tests_log'',  FILENAME = N''' + @device_directory + N'DO40-Tests.ldf'')')
go

answered Jan 02 '10 at 08:00

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

The section is added, see "Creating test database" there.

(Jan 02 '10 at 08:00) Alex Yakunin Alex%20Yakunin's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×574

Asked: Jan 01 '10 at 21:15

Seen: 3,589 times

Last updated: Jan 01 '10 at 21:15

powered by OSQA