First, create a class which will hold all of your variables:
class Item
{
public string Item1 {get;set;}
public string Item2 {get;set;}
public string Item3 {get;set;}
.
.
public string Item15 {get;set;}
}
Now, create a list:
List<Item> items = new List<Item>();
Then, execute MySQL command to fetch data from database and loop through it:
long recCount = 0;
MySqlCommand mySqlCommand = new MySqlCommand();
mySqlCommand.Connection = connection;
mySqlCommand.CommandText = "SELECT COUNT(*) FROM nextcare_form";
recCount = (Int64)mySqlCommand.ExecuteScalar();
if (recCount > 0)
{
mySqlCommand.CommandText = "SELECT * FROM nextcare_form";
MySqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader();
while (mySqlDataReader.Read())
{
if (!DBNull.Value.Equals(mySqlDataReader.GetValue(0)))
{
items.Item1 = (string)mySqlDataReader.GetValue(0);
}
if (!DBNull.Value.Equals(mySqlDataReader.GetValue(1)))
{
items.Item2 = (string)mySqlDataReader.GetValue(1);
}
if (!DBNull.Value.Equals(mySqlDataReader.GetValue(2)))
{
items.Item3 = (string)mySqlDataReader.GetValue(2);
}
.
.
.
if (!DBNull.Value.Equals(mySqlDataReader.GetValue(14)))
{
items.Item15 = (string)mySqlDataReader.GetValue(14);
}
}
}
In this way, you can get and store all the values...
Hopefully, it will solve your problem