I am using the following code for read all image paths that stored in img
column in tb21
table.
NpgsqlDataAdapter da = new NpgsqlDataAdapter("SELECT img FROM tb21", dbcon);
DataSet ds = new DataSet();
List<string> img1 = new List<string>();
foreach (DataRow row in ds.Tables["tb21"].Rows)
{
img1.Add(row["img"].ToString());
}
But, I got an error as:
object reference not set to an instance of an object
what is solution for this?