Hi all,
i started programming with .NET (i have express edition) and wanted to make a conection to an SQL Server.. the problem is that i cant conect :(
previously i had .net 2005 - i started having the issue there - i unistalled it, n installed visual studio 2008.
I have installed SQL Compact that came with the .net 2008, and besides it SQL Server 2000.

When I try to make a conection to the SQL Server, if server is running I have to stop it and then choose the DB i want to use. (if its running wont let me choose any DB). Then, when i select the DB i need, Im getting this error:

"The instruction CREATE FILE fount SO error 5 (failed to retrieve text for this error.Reason:15105) while trying to open or creating the fysichal file : -path- to northwnd_log.ldf.
Cant open the new database -path to northwnd.mdf. CREATE DATABASE discarded.
Error while trying to attach a DB automatically named for archive -path to northwnd.mdf. There already exists a database with the same name, cant open the specified file or it is in a shared UNC resourse.
File activation error. File name -path to northwnd_log.ldf- might be wrong"


And when i try to connect with the SQL compact edition that came installed with the visual studio, im getting this error:

"Can not allow access to the file in DB [File name = path to northwind.sdf]"


And dont know what is that im doing wrong.

Recommended Answers

All 14 Replies

You messed up the installs.

Uninstall everything and Restart.

Then install what you need again.

so i have to reinstall all over again???

yup thats what i said.

i just reinstalled vb.net, and could conect to a sql server compact (came with vb.net) ..
and when trying to make a query into the northwind db, im getting : "error while trying to create de consult, there is no assigment of DbType Ofject to any known SQL Server Compact data type"

Code please

What is the query you made.

the code im using is:

SELECT SupplierID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax, HomePage FROM dbo.Suppliers where SupplierID= @SupplierIDParam

Looks good, can you post your code.

there is no assigment of DbType Ofject to any known SQL Server Compact data type"

This basically means you either didn't make the connection string correctly or You didn't initialize something.

i just re-done the connection all over again..
here is a screen shot on where im now

in String Connection, i just noticed that i have: DataSource=|DataDirectory|\Northwind.sdf

should it be c:\... and all the path till the database?

probably very stupid question.. but idk :$

I asked for code m8.

DataSource=|DataDirectory|\Northwind.sdf

It looks like that is auto generated it should be fine.

re-done it again.. checked the connection String and has the whole path to the db.. the db in the DB explorer is conected.. BUT let me make the sql query without the where clause..
any idea why this happend and how can i make to use the where clause??

thanks in advance!! :)

Seriously?

Do you think I am a psychic? or maybe Yoda?

I asked for one thing the past three posts, which you failed to provide.

Unless you think I GOD, I think you are trolling to just get on my nerves, which you have succeeded in doing.

to make the connection im using a wizard, so i dont have code to paste here. unless u want to have all the screen shots of what im doin..
the sql code, pasted in one of my previous posts

Try and run your SQL query in the SQL Browser.

you should understand what you did wrong.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.