all groups > sql server connect > june 2005 >
You're in the

sql server connect

group:

Can no longer get dataset fill method to work after directory copy


Can no longer get dataset fill method to work after directory copy HermanW
6/23/2005 9:31:01 AM
sql server connect:
I have been creating a small winforms app using VS 2005 and SQL Express. I
create serveral tables in the database and added it as the datasource for the
project. I created several forms, created several datagrids and regular
design views. After I got several of the forms running, I decided to backup
my directory and copied the entire directory to a backup directory on my hard
drive.

While continuing to work on my project, the IDE lost some of the data
adapters and and datasets while I was switching between the design view and
code view. So I decided to delete the directory and copy the backup I had
saved and start from there. But a Big Problem occured. Once I opned the
project and tried to execute it, I could no longer get the app to connect to
the database. I am the only user and administrator account but every time the
app tries to fill a table now I get on of these two erors:

System.Data.SqlClient.SqlException was unhandled
Message="Unable to open the physical file ---- ". Operating system error
5: \"5(Access is denied.)\".\r\nUnable to open the physical file

or

System.Data.SqlClient.SqlException was unhandled
Message="Cannot open user default database. Login failed.\r\nLogin failed
for user
Source=".Net SqlClient Data Provider"
ErrorCode=-2146232060
Class=11
LineNumber=65536
Number=4064
Procedure=""
Server=".\\SQLEXPRESS"
State=1
StackTrace:

I can no longer connect to the database even thou I can see and work with it
in the IDE. Help

--
Re: Can no longer get dataset fill method to work after directory copy lambchop
3/26/2006 12:54:00 AM

Several possible reasons for this:
1) you did not restore your original LDF file with your matching MDF
2) you have not re-attached the database
3) you are trying to connect using an sql user account and it is not
configured the same with the "backed" up version
4) you are trying to connect without the correct user instance
reference (ie. the backed up version is different from the one you
deleted)

If you can see the database from the IDE, then using query analyzer and
run a test query. You can also start OSQL and run a simple query
against the database. If these queries work, then there is something
not synchronized within your code versus the database that was
restored.

Check out
http://tinyurl.com/n93o9

Hope this helps....
-Eric



--
lambchop
------------------------------------------------------------------------
Posted via http://www.webservertalk.com
------------------------------------------------------------------------
View this thread: http://www.webservertalk.com/message1110699.html
AddThis Social Bookmark Button