Skip to content

Need to have records vertically

Israel

Asked Jan 10, 2017, 2:12 AM EST1 answer
Share
LinkedInX
Hi!
 
I use to display my data into my textboxes horizontally as you can see with these code:
 
Java
 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. 

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    I never read data vertically only horizontally as I mentionned. I am not sure if its possible.
    0