Click here to Skip to main content
15,914,500 members

Comments by Jamie Head (Top 7 by date)

Jamie Head 10-Aug-20 17:40pm View    
I have looked over that and am still getting this error, maybe its the NuGet packages I have? https://i.imgur.com/A6uzjsw.png
Jamie Head 10-Aug-20 16:45pm View    
https://i.imgur.com/U1VtgAJ.png
Jamie Head 10-Aug-20 16:41pm View    
using (IDbConnection cnn = new SqliteConnection("Data Source=.\Database\The_G_Database.sqlite;Version=3"))
            {
                
                cnn.Execute("INSERT INTO Main (Member_Name, Member_ID, Member_Roles, Guilds, Points, Level, Exp) VALUES (@Member_Name, @Member_ID, @Member_Roles, @Guilds, @Points, @Level, @Exp)", 
                    new { Member_Name = username, Member_ID = id, Member_Roles = roles, Guilds = guild_id, Points = 0, Level = 0, Exp = 0 });
            }

This is what I mean "hardcode". This using() is still throwing null as a cnn. This user seems to have the same issue -> App.Config file connection string but its connected and am getting the null value reference error[^]
Jamie Head 10-Aug-20 16:22pm View    
Oh. And to answer the App.config question, yes its in the correct directory. It was named AppName.dll.config because its a console app but I have also copied it as AppName.exe.config.
Jamie Head 10-Aug-20 16:19pm View    
I am getting the same error here -> https://www.codeproject.com/Questions/5276170/Sqlite-Csharp-why-am-I-getting-a-null-connection I dont seem to know what is causing it. Maybe its something to do with it being a console app. I have tried manually giving it a connectionString and I still get the same error.