Hello guys, can someone tell me how can I get the values from the columns ?
My sql table is:
Table name: settbl
Table columns: id, first (int), second (int)
...and now, I want to get the values from "first" and "second", but I got the error message "Object reference no set to an instance of an object".
This is my code:
sqlIteCon = new SQLiteConnection("Data Source=set.db;Version=3;New=False;Compress=True;");
sqlIteCon.Open();
string SelectQuery = "SELECT * FROM settbl";
SQLiteCommand sqlCommand = new SQLiteCommand(SelectQuery, sqlIteCon);
SQLiteDataReader sqlRead = sqlCommand.ExecuteReader();
int a = sqlRead.GetInt32(sqlRead.GetOrdinal("first"));
int b = sqlRead.GetInt32(sqlRead.GetOrdinal("second"));
Thanks...