0

what is the pseudo code to get data from the database and view it in your application??

2
Contributors
8
Replies
9
Views
6 Years
Discussion Span
Last Post by Mitja Bonca
0
//sql query
string query = "SELECT * FROM MyTable";
//create connection
SqlConnection sqlConn = new SqlConnection("connString");
//create command
SqlCommand cmd  = new SqlCommand(query, sqlConn);
//create dataAdapter
SqlDataAdapter da = new SqlDataAdapter(cmd);
//Create DataTable:
DataTable table = new DataTable("MyTable");
//fill table:
da.Fill(table);

//to show in your application there is many ways, one is to bind the table with a control (most common is the DataGridView control):
dataGridView1.DataSource = new BindingSource(table, null);
0

thanks mitja ;) now i'll try to convert it into a pseudocode ! :/

0

pseudo code is like an algorithm but it will be more base on code of how to get data from data base.. a step by step PSEUDO CODE , not CODE

0

I really dont know what you mean. I gave you the code, step by step. I dont know what would you like to have more - this is it mate!
If you would have any example about what you are talking, it would be easier....

Edited by Mitja Bonca: n/a

0

Iam sure this is some homework. So try to do it by your self mate. I gave you all the code and even commented it. If you know how to read the code, you can do the pseudo by your self (but I know you can read it correctly - its not a big deal).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.