I have a code that reads the information from the database and assigns it to the list
class YaziciBilgiler
{
public string yaziciAdi;
public List<YaziciBilgiler> YaziciSec()
{
con.Open();
OracleCommand cmd = new OracleCommand("SELECT PRINTER_NAME FROM LABEL_PRINTER ");
DataSet dataset = new DataSet();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
using (OracleDataAdapter dataAdapter = new OracleDataAdapter())
{
dataAdapter.SelectCommand = cmd;
dataAdapter.Fill(dataset);
}
var yazici=dataset.Tables[0].AsEnumerable().Select(datarow=>new YaziciBilgiler
{
yaziciAdi = datarow.Field<string>("PRINTER_NAME")
}).ToList();
con.Close();
return yazici;
}
}
}
Then call the information in the printer list from the form
List<YaziciBilgiler>yazici;
yazici=yb.YaziciSec();
foreach (var item in yazici)
{
cbYazici.Items.Add(item);
}
but instead of the contents of the list, the location is as follows: