|
-
April 3rd, 2015, 12:31 AM
#1
[RESOLVED] OleDbException Unhandled (No value given for one or more required parameters.)
Hello ! I am making a project on Railway reservation system in which I want the user should have access to his booking history . The following code access records from two tables in the database . When I run this code for only one table ( accessing records from one table ) , it works fine but when I run this code for two tables , it gives me an error saying OleDbexception was unhandled ( No values given for more required parameters ) at
Code:
da.Fill(ds, "Table2")
I know this line is wrong , because it is only for one table but I don't know how to do it for two tables . Please help ! Thank you ! This is my full code
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MyConn = New OleDbConnection
MyConn.ConnectionString = connString
ds = New DataSet
tables = ds.Tables
da = New OleDbDataAdapter("Select P.Tnumber, P.Name , P.Age ,T.PNR_Number, P.Train_Name , P.SeatNo , P.Berth , P.Coach_Number , T.Starting_Point , T.Destination , T.Departure , T.Arrival , T.Fare From Table1,Table2 Where P.Train_Name = T.Train_Name and P.Phone= TextBox1.Text ", MyConn)
da.Fill(ds, "Table2")
Dim view As New DataView(tables(0))
source1.DataSource = view
DataGridView1.DataSource = view
Actually , in my project , I want the user to type his phone number and based on the phone number entered by the user , the records from the database will be matched and displayed in the datagridview . Please help !
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|