Last post Sep 16, 2011 11:27 PM by magicmike2011
Sep 16, 2011 08:54 AM|sivamyneni|LINK
I am creating a exe file for one of my web application. I added framework and sql server 2005 express as prerequisites for my exe file.
When I run the application from VS 2005 it s working fine. When I run it from IIS after installing my exe file, it s saying that "User does not have permission to perform this action."
I mentioned this in my web.config for connection string
<add name="Connection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DB\db.mdf;Initial Catalog=;Integrated Security=True;User Instance=true;" providerName="System.Data.SqlClient"/>
Someone told me to write a batch file to attach DB to sql express and create permissions from that batch file. If i am unable to connect to that sql express how can I run that?
Sql Server management studio is not installed in my system,how can I run query from sql express?
I want to give this exe file to a person who does not know anything about .net and sql server. So, it should be easy for him to do at his place
Thanks in advance,
Sep 16, 2011 11:27 PM|magicmike2011|LINK
Here's a thread where I recently helped someone found out basically the same issue, well very similar.
The two links contained in the reply marked as the answer contain information on how to bypass the authorization and permissions in your cirmcumstances. Theres also some great links in the thread that go in depth about embedding sql 2005 express (aswell
as 2008), including and using template.ini files to set the schema, or as I mention in the thread, an alternative to this could be to include a .bak file of a default database and using a utility class to run command lines to do a restore of the .bak file
as part of the installation. Theres also links to an example utility class that gives examples of how to determine if sql 2005 express is already installed, if not, what version is, and how to perform the necessary upgrades, etc.
Hope this helps.