Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such table error #829

Open
beproductivedevelop34 opened this issue Jun 27, 2022 · 1 comment
Open

No such table error #829

beproductivedevelop34 opened this issue Jun 27, 2022 · 1 comment

Comments

@beproductivedevelop34
Copy link

beproductivedevelop34 commented Jun 27, 2022

it gives an error

E/Dart    ( 4638): Invalid UTF8 sequence encountered, 
E/Dart    ( 4638): (Error Code: FD + idx: 234 )
E/Dart    ( 4638): (Error Code: 64 + idx: 235 )
E/Dart    ( 4638): (Error Code: 22 + idx: 236 )
E/Dart    ( 4638): (Error Code: 20 + idx: 237 )
E/Dart    ( 4638): (Error Code: 3A + idx: 238 )
E/Dart    ( 4638): (Error Code: 20 + idx: 239 )
E/Dart    ( 4638): (Error Code: 69 + idx: 240 )
E/Dart    ( 4638): (Error Code: 64 + idx: 241 )
E/Dart    ( 4638): (Error Code: 2C + idx: 242 )
E/Dart    ( 4638): (Error Code: D + idx: 243 )
E/Dart    ( 4638): 
E/Dart    ( 4638): Invalid UTF8 sequence encountered, 
E/Dart    ( 4638): (Error Code: FD + idx: 234 )
E/Dart    ( 4638): (Error Code: 64 + idx: 235 )
E/Dart    ( 4638): (Error Code: 22 + idx: 236 )
E/Dart    ( 4638): (Error Code: 20 + idx: 237 )
E/Dart    ( 4638): (Error Code: 3A + idx: 238 )
E/Dart    ( 4638): (Error Code: 20 + idx: 239 )
E/Dart    ( 4638): (Error Code: 69 + idx: 240 )
E/Dart    ( 4638): (Error Code: 64 + idx: 241 )
E/Dart    ( 4638): (Error Code: 2C + idx: 242 )
E/Dart    ( 4638): (Error Code: D + idx: 243 )
E/Dart    ( 4638): 
E/SQLiteLog( 4638): (1) no such table: Persons
E/flutter ( 4638): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: DatabaseException(no such table: Persons (code 1): , while compiling: SELECT * FROM Persons) sql 'SELECT * FROM Persons' args []
E/flutter ( 4638): #0      wrapDatabaseException (package:sqflite/src/exception_impl.dart:11:7)
E/flutter ( 4638): <asynchronous suspension>
E/flutter ( 4638): #1      SqfliteDatabaseMixin.txnRawQuery.<anonymous closure> (package:sqflite_common/src/database_mixin.dart:404:30)
E/flutter ( 4638): <asynchronous suspension>
E/flutter ( 4638): #2      BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
E/flutter ( 4638): <asynchronous suspension>
E/flutter ( 4638): #3      SqfliteDatabaseMixin.txnSynchronized (package:sqflite_common/src/database_mixin.dart:344:14)
E/flutter ( 4638): <asynchronous suspension>
E/flutter ( 4638): #4      KisilerO.readData (package:database/KisilerO.dart:15:37)
E/flutter ( 4638): <asynchronous suspension>
E/flutter ( 4638): #5      _MyHomePageState.writedData (package:database/main.dart:37:26)
E/flutter ( 4638): <asynchronous suspension>
E/flutter ( 4638): 

codes

import 'dart:core';
import 'dart:async';
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
import 'package:database/Kisiler.dart';
var name;
class KisilerO{

  static Future<Database> init() async{
    return openDatabase(join(await getDatabasesPath(),"uns.db"));
  }
  static Future<List<Kisiler>> readData() async{
    var db = await init();
    List<Map<String,dynamic>> map = await db.query("Persons");
    return List.generate(map.length, (index) {
      return Kisiler(
        id : map[index]["id"],
        isim : map[index]["isim"],
        yas : map[index]["yas"],

      );
    });
  }
}
import 'package:flutter/material.dart';
class Kisiler {
  late int id;
  late String isim;
  late int yas;
  Kisiler({required this.id,required this.isim,required this.yas});
  Map<String,dynamic> toMap(){
    return {
      "ıd" : id,
      "name" : isim,
      "old" : yas
    };
  }
}
@FDhunterz
Copy link

maybe you can try https://pub.dev/packages/sql_query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants