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.

9 Years
Discussion Span
Last Post by __avd

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"

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 
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

Edited by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).


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.

Edited by Nick Evan: Fixed formatting

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.