search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Problem with datatable?

Asked by ero
6 years ago.

hi there !

i create in sql server a database name 'db' then i create two tables event and resource i change in web config a datasource to my own sql server...

i have got error in this

<pre>

SQLiteDataAdapter da = new SQLiteDataAdapter("SELECT [id], [name], [bath], [beds] FROM [resource] WHERE beds = @beds or @beds = '0'", ConString.Get(this));
da.SelectCommand.Parameters.AddWithValue("beds", roomFilter);
DataTable dt = new DataTable();
da.Fill(dt);

</pre>

it says:

Unable to open the database file

i dont understand why it says it i copy my connection sting to my database...

Answer posted by Dan Letecky
6 years ago.

You have probably used one of the tutorials that work with an embedded SQLite database.

You should replace SQLiteDataAdapter with SqlDataAdapter to use SQL server instead.

This question is more than 6 months old and has been closed. Please create a new question if you have anything to add.