有没有人知道如何解决此错误消息
错误CS1729:’sqliteConnection’不包含带有1个参数的构造函数(CS1729)
这是它正在发生的文件
using System;using System.Collections.Generic;using System.linq;using System.Text;using AndroID.App;using AndroID.Content;using AndroID.OS;using AndroID.Runtime;using AndroID.VIEws;using AndroID.Widget;using sqlite;using AndroID.Util;using sqlite.Net;namespace CPDEP1{ public class DataBase { string folder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); public bool createDataBase() { try { using (var connection = new sqliteConnection(System.IO.Path.Combine(folder, "Persons.db"))); { connection.Createtable<Person>(); return true; } } catch(sqliteException ex) { Log.Info("sqliteEx", ex.Message); return false; } } public bool insertIntotablePerson(Person person) { try { using (var connection = new sqliteConnection(System.IO.Path.Combine(folder, "Persons.db"))) { connection.Insert(person); return true; } } catch(sqliteException ex) { Log.Info("sqliteEx", ex.Message); return false; } } public List<Person> selecttablePerson() { try { using (var connection = new sqliteConnection(System.IO.Path.Combine(folder, "Persons.db"))) { return connection.table<Person>().ToList(); } } catch (sqliteException ex) { Log.Info("sqliteEx", ex.Message); return null; } } public bool updatetablePerson(Person person) { try { using (var connection = new sqliteConnection(System.IO.Path.Combine(folder, "Persons.db"))) { connection.query<Person>("UPDATE Person set Nom=?,Prenom=?,Telephone=?,Addresse=?,CourrIEl=?,Cin=? Where ID=?,",person.Nom,person.Prennom,person.Telephone,person.Addresse,person.CourrIEl,person.Cin,person.ID); return true; } } catch (sqliteException ex) { Log.Info("sqliteEx", ex.Message); return false; } } public bool deletetablePerson(Person person) { try { using (var connection = new sqliteConnection(System.IO.Path.Combine(folder, "Persons.db"))) { connection.Delete(person); return true; } } catch (sqliteException ex) { Log.Info("sqliteEx", ex.Message); return false; } } public bool selectquerytablePerson(int ID) { try { using (var connection = new sqliteConnection(System.IO.Path.Combine(folder, "Persons.db"))) { connection.query<Person>("SELECT * FROM Person Where ID=?", ID); return true; } } catch (sqliteException ex) { Log.Info("sqliteEx", ex.Message); return false; } } }}
在此先感谢您的帮助
解决方法:
我按照这里的说明:https://wolfprogrammer.com/2016/09/10/adding-a-sqlite-database-to-xamarin-forms/并得到了同样的错误.
然后我在这里提到了Microsoft指令(https://msdn.microsoft.com/en-us/magazine/mt736454.aspx),并注意到有两个非常相似的东西都是由Frank Krueger编写的.请检查下面的图像,下载以绿色突出显示的图像,而不是红色图像.
总结以上是内存溢出为你收集整理的c# – :错误CS1729:’SQLiteConnection’不包含带有1个参数的构造函数(CS1729)全部内容,希望文章能够帮你解决c# – :错误CS1729:’SQLiteConnection’不包含带有1个参数的构造函数(CS1729)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)