Question MS-SQL to SQLITE syntax problem

Rinaldo

New member
Joined
Jan 7, 2020
Messages
1
Location
Amsterdam the Netherlands
Programming Experience
5-10
Hi everyone,

I have a database SqLite and need to substract data from it and put them in a combobox in a datagridview. I have a solution from the MSDN devolpers network but the systax is not suitable voor SqLite.
The following statement is the error generated by VS2017: SqlDesigner.ExecuteDataSet("select Date from test where Name='" + s + "'"); The SqlDesigner cannot be found. Must I get more references from SqLite? Using somewhat. Programming in C#.
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,049
Location
Sydney, Australia
Programming Experience
10+
Just use straight ADO.NET, like you would for any database. That class is not part of the.NET Framework and must have been created specifically for that example. No one uses that for SQL Server either. There is a dedicated SQLite provider for ADO.NET that you can probably add as a NuGet package.
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
1,575
Location
Virginia Beach, VA
Programming Experience
10+

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,049
Location
Sydney, Australia
Programming Experience
10+
I was wonder what "solution from the MSDN devolpers network" was being referred to. Common sense would dictate providing a link to it. With or without the link, I'm guessing that that class is the poster's own DAL class and that ExecuteDataSet would simply contain the same ADO.NET code that anyone else can write for themselves, i.e. creating a DataSet and a data adapter and returning the DataSet after populating it with a call to Fill on the data adapter, using whatever ADO.NET provider is appropriate for their database.
 
Top Bottom