i am doing online railway reservation project in vb.net. i want to know when i click on one radiobutton of trainno and then after clicking on submit button it display corresponding routes from database. i am using oracle as backend.please tell me urgently.

Recommended Answers

All 5 Replies

hii,
u can use "select" query with "where" condition to get data from the database.the condition should be train no,if u have table in oracle contianing trainno and routes of that specified train no as columns .u can display this data in the form of a datagrid,there are many controls in which we can display this data like repeater or datalist.

in your database you should have a primary key. this should be a unique number to identify each train you have on course. with this, you can use your sql SELECT statement to get the information you want
for example,
SELECT * from Trains WHERE TrainID = "354523"

show wt have u done so far..?

imports system.data
imports system.data.sqlclient

public class form 1
 dim con as new sqlconnection = _
("server = localhost; database = databasename; user id = sdsfj; passwor = nhsdu")
dim objdataadapter as dataadpter
dim objdataset as dataset 

privates sub button1_clicked 
if radiobutton1.checked = true then 
con.open 
with objdataadapter 
.selectcommand =    dim strget as as string = "SELECT * FROM train WHERE trainID "'+radiobutton1.
''''
'''''
''''
''''
objdata.fill(objdataset, train)
with datagridview1

write codes here to display the data on a datagrid using a for..next loop
end with

Hi chibex64.

Please do not resurrect threads that are years old. By doing so you run the risk of confusing current posters. If you have any questions please ask. You are welcome to start your own threads.

For easy readability, always wrap programming code within posts in CODE

Thread Closed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.