• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Quick VB/SQL question

dsk4

[H]ard|Gawd
Joined
Mar 16, 2000
Messages
1,870
ok, so here is the problem: I've used the SQL Server 2008 R2 Import Export Data utility to copy/convert an excel sheet to a "Microsoft OLE DB Provider for SQL Server" destination. I would now like to open this data file in Visual Studio 2008 Express. So far I have tried two methods with no success:

1) use "add existing item" on the project menu to find the data file to copy the file into VS2008 and move it to the Debug sub-folder - this does not work, as I get a msgbox saying simply "Access is Denied"

2) I have tried to manually paste the data file into the DeBug sub-folder, but here a get a message saying that the file is being used by another program and it can't be copied.....no other programs are open...I even did a restart to ensure this.

Any suggestions? This relatively simple problem has wasted a lot of my time...

Thanks!
 
It sounds like you put your excel data into a sql server database and now want to use that database in your code. Generally, you don't want to store the .mdf/.ldf files inside your solution. What you do need to do is create a connection string to your database for development use.

Is this a web(asp.net) or windows application? There is a ton of different ways to setup your connection depending on the type of data access you are using. If you plan on using linq to sql or entity framework, you should be able to add that type of item to your solution and it should help you setup the connection. You still may have to use the server explorer and drag tables from there into the linq to sql designer though.

Another way to have the server/database show up is to use the server explorer in VS. If it's not showing already go to view>server explorer from the top menu. You should be able to add a connection to an existing db through there.

As far as #2 goes, the mdf/ldf files are locked by the mssql server Service that is running automatically on startup. You could stop the service and move them, but is not recommended.
 
Back
Top