1

I want to fetch data from SQLite database in Maui using raw Query. But while trying this function I am getting error:

>{System.ArgumentNullException: Value cannot be null. (Parameter 'type') at System.ArgumentNullException.Throw(String paramName) at System.ArgumentNullException.ThrowIfNull(Object argument, String paramName) at System.Reflection.IntrospectionExtensions.GetTypeInfo(Type type) at SQLite.TableMapping.GetPublicMembers(Type type) at SQLite.TableMapping..ctor(Type type, CreateFlags createFlags) at SQLite.SQLiteConnection.GetMapping(Type type, CreateFlags createFlags) at SQLite.SQLiteCommand.ExecuteQuery[Object]() at SQLite.SQLiteConnection.Query[Object](String query, Object[] args) at SQLite.SQLiteAsyncConnection.<>c__DisplayClass83_0`1[[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<QueryAsync>b__0(SQLiteConnectionWithLock conn) at SQLite.SQLiteAsyncConnection.<>c__DisplayClass32_0`1[[System.Collections.Generic.List`1[[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<ReadAsync>b__0() at System.Threading.Tasks.Task`1[[System.Collections.Generic.List`1[[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj) public async Task<List<dynamic>> GetItem() { var queryResult = await _db.QueryAsync<dynamic>("SELECT InvItm.*, BaseItmDet.*, FraCount FROM InvItm LEFT JOIN UnitsTb ON UnitsTb.Units = InvItm.Unit LEFT JOIN BaseItmDet ON InvItm.BaseId = BaseItmDet.BaseItemId WHERE ItemCode = '2'"); return queryResult.ToList(); } 
7
  • Post the actual full exception text. There's no parameter named type in the code you posted. The full exception text includes any inner exceptions and a stack trace that shows where the exception really came from and which function calls caused it Commented Dec 22, 2023 at 13:58
  • @PanagiotisKanavos System.ArgumentNullException: 'Value cannot be null. (Parameter 'type')' Commented Dec 22, 2023 at 14:27
  • That's not the full exception text. Post the entire text returned by Exception.ToString() or by clicking on the Copy Details link in the exception popup Commented Dec 22, 2023 at 14:32
  • this is what i get when i copy details Commented Dec 22, 2023 at 14:47
  • QueryAsync<T> if i use like this , When i am using this function i may need to do like GetItem<T>(); Then what's the use . I want to dynamically fetch item . Commented Dec 22, 2023 at 15:10

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.