Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > connection to Databse ??
 

connection to Databse ??

hi

i'hv developed clockonce application which installed on client machine and runs succesfully

i am trying to connect to database(which is on server) from clickOnce appl. with the following statement -
connPatient = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=http://myServer/ServerStorage/myDB.mdb")

but it is giving me error .

pl tell what is the coorect method of connecting to database from clickOnce appl.

thanks
Shital
ShitalP  Monday, April 23, 2007 6:28 AM
You can use the classes within the System.Data namespace to establish direct connections with a database server such as SQL Server on your network, but you must account for the security issues. Unlike HTTP requests, database connection requests are always forbidden by default under partial trust; you will only have such permission by default if you install your ClickOnce application from a CD-ROM. This gives your application full trust. To enable access to a specific SQL Server database, your application must request SqlClientPermission to it; to enable access to a database other than SQL Server, it must request OleDbPermission.

Most of the time, you will not have to access the database directly, but will access it instead through a Web server application written in ASP.NET or an XML Web service. Accessing the database in this manner is frequently the best method if your ClickOnce application is deployed from a Web server. You can access the server in partial trust without elevating your application's permissions.

For more information,see this topic: Accessing Local and Remote Data in ClickOnce Applications
Zhi-Xin Ye  Friday, April 27, 2007 9:19 AM
You can use the classes within the System.Data namespace to establish direct connections with a database server such as SQL Server on your network, but you must account for the security issues. Unlike HTTP requests, database connection requests are always forbidden by default under partial trust; you will only have such permission by default if you install your ClickOnce application from a CD-ROM. This gives your application full trust. To enable access to a specific SQL Server database, your application must request SqlClientPermission to it; to enable access to a database other than SQL Server, it must request OleDbPermission.

Most of the time, you will not have to access the database directly, but will access it instead through a Web server application written in ASP.NET or an XML Web service. Accessing the database in this manner is frequently the best method if your ClickOnce application is deployed from a Web server. You can access the server in partial trust without elevating your application's permissions.

For more information,see this topic: Accessing Local and Remote Data in ClickOnce Applications
Zhi-Xin Ye  Friday, April 27, 2007 9:19 AM

You can use google to search for other answers

Custom Search

More Threads

• Windows Control in IE, Problem Accessing Database, Strong Name doesn't seem to work
• Replace Maintenanceform by Delete Program
• how to add Uninstall link in startup menu
• How to obtain a reference to mshtml.HTMLDocument from an embedded UserControl?
• ClickOnce app no longer installing under Publisher Name folder in Start Menu
• Problem in launching application
• Can't get a password-protected PFX to "stick" in store. Build fails with password dialog.
• issue changing config files of clickonce setup deployment.
• Packaging Interop Files
• autoupdater for VS deployments