How to get records from a database?
Answer / Saurabh Kumar
To retrieve records from a database in C#.NET, you can use ADO.NET classes like SqlCommand, SqlDataReader, or DataTable. Here's an example using SqlCommand and SqlDataReader: SqlConnection connection = new SqlConnection(connectionString); SqlCommand command = new SqlCommand("SELECT * FROM table", connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { // process each record here }
| Is This Answer Correct ? | 0 Yes | 0 No |
What are windows based applications examples?
Is typeform free?
Name the class to be inherited for creating a custom control.
Which controls can not be placed in MDI ?
Which event occurs when a user drags an item in a treeview or listview control?
which Property is used to count no. of items in a combobox?
What is form and meaning?
how print PGL by XML
1 Answers Bank Of America, Wipro,
What are the different types of JOINs in SQL Server?
Explain the new events in textbox that has been included in vb?
How do you customize the column content inside the datagrid?
How do you hide the columns in datagrid?