Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I display database contents onto c# textbox
    primarykey
    data
    text
    <p><strong>Background</strong> I'm transferring values from a text file to an sqlite database. The values are stored in lists then transferred into the database (Below)</p> <p><img src="https://i.stack.imgur.com/K22cx.png" alt="enter image description here"></p> <p><strong>What I want</strong> Now I want to get the values from the database and output them to a textbox in the application. Basically the user should click a button saying " Show file" which should simply display all of the column values from the database into the c# textbox, in essence I simply recreate the database (in the textbox).</p> <p><strong>The Problem:</strong> <em>I simply don't know sqlite or sql syntax (new programmer).</em> I understand I'll have to run a query using select, but then how would I select all the columns and then show all of them in the text box?</p> <p><strong>My Attempt so far:</strong> (Might have some obvious mistakes)</p> <pre><code> sqlite_cmd.CommandText = "SELECT * FROM abc"; //Command object gives us a datareader object sqlite_datareader = sqlite_cmd.ExecuteReader(); private void textBox1_TextChanged_1(object sender, EventArgs e) { // SQlite datareader allows us to run through the lines // while ( sqlite_datareader.Read()) { // Below is my approach on trying to display all column values // textbox1.Text = sqlite_datareader["Seq", "Field "," Desc "," Len ", etc etc ]; } } </code></pre> <p>}</p> <p><strong>SideNote:</strong> As the contents of the database are huge, and the textbox size is limited, it would be great if I could get some horizontal and vertical scrollbars</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload