Click here to Skip to main content
15,887,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends I developed a simple mail application in Asp.net(VS 2008) using C# and Database connectivity using ODBC with Sql Server 2005.

Actually i developed the entire project in file system. The application run excellent in VS now I want to run the application in IIS 5.0.

I also right click solution explorer and published but I cannot find "cs" files and I was unable to connect with database.

Please tell me how to run the application in IIS. I have IIS 5.0 in my system.

Here is my connection string

XML
<connectionStrings>
 <add name="BuiltTech" connectionString="Dsn=built;app=Microsoft® Visual Studio® 2008;wsid=PRASHANTH;database=BuiltMaster;network=DBMSSOCN;trusted_connection=no;user=<windows_login_username>;password=<windows_login_password>"
  providerName="System.Data.Odbc" />
</connectionStrings>


This is my Error

Server Error in '/builttech' Application.
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Thanks in Advance
Posted
Updated 29-Dec-11 18:23pm
v3

Do you get any error message about the connection. Since you're using a trusted connection, the credentials running the process should be defined so that the user has access to the database (is listed as a login in the SQL Server). When you run the app in the desktop, your user account is used so it's a bit different situation.

Simple way to try if this is the problem is that create a SQL Server authenticated user with username and password. After that change your connection string:
XML
<connectionStrings>
 <add name="BuiltTech" connectionString="Dsn=built;app=Microsoft® Visual Studio® 2008;wsid=PRASHANTH;database=BuiltMaster;network=DBMSSOCN;trusted_connection=No;User=<UserName>;Password=<Password>"
  providerName="System.Data.Odbc" />
</connectionStrings>
 
Share this answer
 
Comments
Balakrishnan Dhinakaran 30-Dec-11 0:12am    
yes i gave but i am getting this error

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Wendelius 30-Dec-11 1:42am    
So you propably haven't defined a DSN using ODBC Manager in COntrol Panel. Try adding the dsn named BUILT. If you're using 64 bit windows, then use the 32 bit version of ODBC manager using %windir%\SysWOW64\odbcad32.exe
Balakrishnan Dhinakaran 30-Dec-11 1:52am    
I got the solution I just changed permission settings for my database
Wendelius 30-Dec-11 1:54am    
Thats good to hear :)
To publish your web site : right click on your project in solution explorer -> select publish -> give the name for the virtual directory -> OK.

your site will publish in local pc IIS. see this link[^] , this may help you.
 
Share this answer
 
Comments
Balakrishnan Dhinakaran 29-Dec-11 4:26am    
Yes I have done this but I am not able to connect with database

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