Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How Do I Debug This?

Posted on 2008-10-14
7
Medium Priority
?
726 Views
Last Modified: 2012-05-05
I have tested a web app and then deployed it to the site. When trying to open it I get an error that it cannot open the database.
The database is present and the path is correct.
The query is (see code snippet):

SELECT [Name] FROM [Cabinet] WHERE ([Position] = ?)

with default parameter = "District Governor"

The stack trace shows instructions leading up to the error but does not help me in determining why I cannot open the database file.  Can someone suggest how to use this to get to the why, not just the where?
From Default.aspx:
 
                        <asp:SqlDataSource ID="DGNameDataSource" runat="server" ConnectionString="data source=E:\VisualStudio2005\Projects\MD12S\App_Data\lions12s.s3db"
                            ProviderName="System.Data.SQLite" SelectCommand="SELECT [Name] FROM [Cabinet] WHERE ([Position] = ?)">
                            <SelectParameters>
                                <asp:Parameter DefaultValue="District Governor" Name="Position" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
 
 
Stack Trace:
 
 
[SQLiteException (0x80004005): Unable to open the database file]
   System.Data.SQLite.SQLite3.Open(String strFilename, SQLiteOpenFlagsEnum flags, Int32 maxPoolSize, Boolean usePool) +206
   System.Data.SQLite.SQLiteConnection.Open() +2141
   System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +31
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1297
   System.Web.UI.WebControls.SqlDataSource.Select(DataSourceSelectArguments arguments) +19
   MD12S._Default.GetDGName() in E:\VisualStudio2005\Projects\MD12S\Default.aspx.vb:41
   MD12S._Default.Page_Load(Object sender, EventArgs e) in E:\VisualStudio2005\Projects\MD12S\Default.aspx.vb:10
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

Open in new window

0
Comment
Question by:rkulp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 8

Accepted Solution

by:
tiagosalgado earned 2000 total points
ID: 22710855
In your server, do you have you database in this path?
data source=E:\VisualStudio2005\Projects\MD12S\App_Data\lions12s.s3db
You need a valid path of your database after publishing your website.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 22710950
Are you able to open the database on the development computer? It could be that the ASP.NET account does not have access permissions to the folder and drive. Try by copying the database file to the app folder.
0
 
LVL 7

Expert Comment

by:Maverick_Cool
ID: 22711090
give the annomyous access the full/required access to that drive
0
Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

 
LVL 1

Author Closing Comment

by:rkulp
ID: 31505852
Thanks. I should have checked that myself. Please color me embarassed.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 22715269
in your question you said yourself that the database IS there at the specified path and now you accepted the answer which said database should be present at the path.
0
 
LVL 1

Author Comment

by:rkulp
ID: 22715328
I failed to notice that the path in the error message and the xml snippet was incorrect. I apologize for my error.
0
 
LVL 1

Author Comment

by:rkulp
ID: 22716123
The only resolution was to change the connection string to point to the |DataDirectory| rather than the physical path.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question