Home Unanswered Active Tags New Question

Problem with datatable?

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...

Asked by ero 11 months ago.
Replies

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.

Answer posted by Dan Letecky 11 months ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java