Israel

Israel

  • 701
  • 1.3k
  • 217.2k

Need to have records vertically

Jan 10 2017 7:12 AM
Hi!
 
I use to display my data into my textboxes horizontally as you can see with these code:
 
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\LunaFoods\App_Data\test.mdb;Persist Security Info=False";
OleDbConnection sqlCon = new OleDbConnection(connectionString);
sqlCon.Open();
string commandString = "select * from table where ID ='" + label15.Text + "'";
OleDbCommand sqlCmd = new OleDbCommand(commandString, sqlCon);
OleDbDataReader read = sqlCmd.ExecuteReader();
if (read.HasRows)
{
while (read.Read())
{
txtbx1.Text = read["A"].ToString(); // it will show the code
txtbx2.Text = read["B"].ToString();
txtbx3.Text = read["C"].ToString();
 
Now I need to display my codes vertically :
For instance, I have a table with three columns (A, B, C) with records and 6 textboxes in two groups of textboxes (3 texboxes on top and others three above):
txtbx1  txtbx2  txtbx3
txtbx4  txtbx5  txtbx6
 
Means that after to save two diferents records I need to have the first line record into txtbx1 txtbx2 txtbx3 and the second line record into txtbx4 txtbx5 txtbx6
 
Please I need this logic.
Thanx in advance,
Israel. 
 
 

Answers (1)