Is column returned null? if (Reader1[“LanguageImage”].GetType() != typeof(DBNull)) LanguageImage = (byte[])Reader1[“LanguageImage”]; Set column to null Command1.Parameters.AddWithValue("@LanguageImage", DBNull.Value);
Category: SELECT
SELECT Queries
SELECT Query Example Command1 = new System.Data.SQLite.SQLiteCommand(Connection1); Command1.CommandText = "SELECT * FROM MyTable WHERE SomeColumnName >= @StartValue AND SomeColumnName <= @EndValue"; Command1.Parameters.AddWithValue("@StartValue", 14); Command1.Parameters.AddWithValue("@EndValue", 28); System.Data.SQLite.SQLiteDataReader Reader1 = Command1.ExecuteReader(); { while (Reader1.Read()) { //MyVariable = Convert.ToString(Reader1[“SomeColumnName1”]); //MyVariable2 = Convert.ToInt32(Reader1[“SomeColumnName2”]); } } Reader1.Close(); Getting Count Of Rows Returned //Get the number of results that will be […]