小编Rei*_*rdt的帖子

无法从字符串转换为int32

我遇到了一个问题,我只能在单个文本框中从数据库中检索数据.我想要的是,我想从数据库中检索每个文本框的数据,但是当我尝试时,得到错误:

这是代码:

string connectionString = (@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\Archives\Projects\Program\Sell System\Sell System\App_Data\db1.accdb;Persist Security Info=False;");

private List<List<TextBox>> textBoxCodeContainer = new List<List<TextBox>>();
private List<List<TextBox>> textBoxQuantityContainer = new List<List<TextBox>>();
private List<List<TextBox>> textBoxDescContainer = new List<List<TextBox>>();
private List<List<TextBox>> textBoxSubTotalContainer = new List<List<TextBox>>();
private List<List<TextBox>> textBoxTotalContainer = new List<List<TextBox>>();

private void Form1_Load(object sender, EventArgs e)
{  
    UpdateTextPosition();

    OleDbDataReader dReader;
    OleDbConnection conn = new OleDbConnection(connectionString);
    conn.Open();
    OleDbCommand cmd = new OleDbCommand("SELECT [Code] FROM [Data]", conn);

    dReader = cmd.ExecuteReader();

    AutoCompleteStringCollection codesCollection = new AutoCompleteStringCollection();

    while (dReader.Read())
    {
         string numString = …
Run Code Online (Sandbox Code Playgroud)

c# database winforms

5
推荐指数
1
解决办法
1201
查看次数

标签 统计

c# ×1

database ×1

winforms ×1