Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Grant login and database access to end user
 

Grant login and database access to end user

What is the best way to grant login and database access toan end user in a ClickOnce application?

Thanks

Giggiehurtz  Thursday, July 24, 2008 7:37 AM

Hi Giggiehurtz,

Based on my understanding, the database file of a ClickOnce application is installed to the ClickOnce Data Directory and is not the same directory as the application. Thus we should get the database from the Data Directory. The following thread might help you with the correct connection string.

For more details about data file in ClickOnce, please check:
http://msdn.microsoft.com/en-us/library/d8saf4wy(VS.80).aspx
http://msdn.microsoft.com/en-us/library/bb756885.aspx

Best regards.
Rong-Chun Zhang

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Rong-Chun Zhang  Monday, July 28, 2008 8:55 AM

An attemp to access the database included in a ClickOnce download retruns an "attempt to auto-attach database" failure message.

File.Exists(<database name and path>) returns false, but I can see that the file does exist by looking on the hard drive.

As File.Exists will return false if the caller does not have the required permsissions, so I believe that this must be the cause of the problem.

What's the best way to give the required permissions?

Giggiehurtz  Thursday, July 24, 2008 8:25 PM

Hi Giggiehurtz,

Based on my understanding, the database file of a ClickOnce application is installed to the ClickOnce Data Directory and is not the same directory as the application. Thus we should get the database from the Data Directory. The following thread might help you with the correct connection string.

For more details about data file in ClickOnce, please check:
http://msdn.microsoft.com/en-us/library/d8saf4wy(VS.80).aspx
http://msdn.microsoft.com/en-us/library/bb756885.aspx

Best regards.
Rong-Chun Zhang

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Rong-Chun Zhang  Monday, July 28, 2008 8:55 AM
Giggiehurtz wrote:

An attemp to access the database included in a ClickOnce download retruns an "attempt to auto-attach database" failure message.

File.Exists(<database name and path>) returns false, but I can see that the file does exist by looking on the hard drive.

As File.Exists will return false if the caller does not have the required permsissions, so I believe that this must be the cause of the problem.

What's the best way to give the required permissions?

What database are you using? SQLServer, SQLServerExpress, SQLServerCE, Access, Oracle, Sybase?

Are you deploying it with the ClickOnce application? How are you deploying it? It is an included file?

RobinS.

GoldMail.com

RobinDotNet  Tuesday, July 29, 2008 8:44 PM

You can use google to search for other answers

Custom Search

More Threads

• SQL Server 2005 SP2 as Prerequisite?
• ClickOnce application won't start
• install set up error in vista 64 bit.
• Setup and app.config : how to not overwrite existing config while installing a newer version ?
• c# and .mdb or any other database application
• Application with different images each time.
• SETUP in VS2005
• Change System Path in setup projects
• Click Once Install Error
• Invalid Operation Exception while installing from CD