1
Answer

How to Print the data of MS Access in C#

Prachi Jk

Prachi Jk

12y
1.4k
1
Hello,

I am developing one school-application. The detail is as follows:
(1) I have a database(MS ACCESS) named SCHOOL
(2) In that database, there is one table named student_det.
(3) There are 5 fields in that table which are roll_no, name, age, addr and class.
(4) Now, i want to extract data from the database depending on the selection of the roll_no of the student from the front-end
(5) I want to build this application in such a way that, suppose, programmer enter any roll_no, then it will print the details of that student, with School-name on the top (like-wise, shopping-receipts, where, shop name is written on top)

Please help in this.

Thanks and Regards
Answers (1)
0
kedar pawgi

kedar pawgi

NA 20 5.7k 12y
You will have to fire a query of table "school".

The query will be :---

  The following query need to be fired on a button click event.

  string qry = "select * from school where roll_no=' "+ convert.ToInt32( textbox1.text )+" ' ";
 
 
  In above query textbox1 is where u r going to accept the roll no or if its combobox then replace textbox1 with combobox1. As "roll_no " is integer (expected to be integer) the value from textbox or combobox need to convert to integer.
 

For the other details like shopping-receipt u have to do the same type of query depending on ur primary key. To Display it on top u have arrange that thing into the report properly as u want.

Hope this will work for u.