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

Problem with datatable?

Asked by ero
10 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


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();


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
10 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 3 months old and has been closed. Please create a new question if you have anything to add.