我正在尝试将一行 SQL 数字加载到多个文本框中。基本上,该行包含用“;”分隔的数字。我怎样才能得到它,以便每个数字在用“;”分隔时 是在自己的文本框中吗?
SqlConnection conn = new SqlConnection("Data Source=LAURA-PC;Initial Catalog=Sudoku;Integrated Security=True");
conn.Open();
SqlCommand command = conn.CreateCommand();
command.CommandText = "Select puzzle from Puzzle";
command.CommandType = CommandType.Text;
SqlDataReader reader = command.ExecuteReader();
if (reader.Read())
{
textBox1.Text = reader.GetValue(0).ToString();
textBox2?
textbox3?
}
conn.Close();