Click here to Skip to main content
16,017,257 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello To All of You,

I am working with visual studio 2010 c# , I Develop one windows application and for database connectivity i use SQL Server authentication , I manage that database using sql management studio from outside the application.

Now I want to stored my application setup and connected database both in one USB Drive.

When ever i open the application in USB Drive it connect the database which is stored in Drive and what ever transaction i done with the database it also stored on same location...

So Any One know about this Please help me, And if possible than give me step by step solution which i can understand and perform well.



Thanks and Regards,
Posted
Updated 19-Nov-13 1:49am
v2
Comments
BillWoodruff 19-Nov-13 14:20pm    
I do not believe this is possible unless the computer running your app in the pen/usb drive has the appropriate .NET FrameWork installed in it.

Your best strategy may be to use the .NET Client Library, and use the ClickOnce install facility.
Ankit Patel(AP) 23-Nov-13 2:33am    
Hello BillWoodruff

Thanks for Reply But thing is that i install software in pendrive and it's work fine but i want my database also in the same location and that thing i don't know how to do if you have any idea than please tell me.

Thanks and Regards

1 solution

It's not possible to store and use MS SQL database placed on USB drive. Why? Please, choose your SQL server version and read this: Hardware and Software Requirements for Installing SQL Server 2012[^].

To make portable application using MS VS 2010, you need to store data in any other sources: XML, text files (delimited text), etc. Other requirements you'll find here:
C# Portable Exe File[^]
Writing Portable Code in C++[^]
What are portable class libraries?[^]
 
Share this answer
 
Comments
Ron Beyer 19-Nov-13 14:22pm    
+5, seems like SQLite would be a better fit for this application than SQL Server. SQL Server is meant to be a network database, if you aren't using it in a network app its better to use something more portable.
Maciej Los 19-Nov-13 14:23pm    
Thank you, Ron ;)
Ankit Patel(AP) 23-Nov-13 2:30am    
But I Develop 90% of application and it is not possible to transfer all the database to sqllite because i also done code using a stored producer and as per my knowledge sqllite is not supported to stored producers,
So there is any other solution than please tell me

Thanks and Regards

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900