Click here to Skip to main content
15,913,183 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone kindly help me with my problem:

Through the use of VB.NET i would like to know if a row in ms access exists or not. If it does exist then it should set the variable pass = true else should be false.

Im doing a school application program and what user needs to select is the year they wish to start now the database has the previous 10 years etc and in October every year it adds the new year to accept application for the next year.

but the problem i have is if someone selects to start for e.g 2013 before october i needed the program to check the database to see if the row of 2013 (row 12) exits if it does then accept application if row 12 (2013) does not exist give error message.

How can i achieve this??

I just need to know how to check the row information..
Please can someone kindly help

i have tried this code:

VB
 Try 
sql = ("SELECT * FROM Application") 
Dim dsx As New DataSet("app") 
Dim dax As New OleDb.OleDbDataAdapter 
dax = New OleDb.OleDbDataAdapter(sql, con)
 dax.Fill(dsx, "app")
 Dim tblapplications As DataTable 
tblapplication = dsx.Tables("app") 

If dsx.Tables("app").Rows.count = nothing Then 
msgbox("Year does not exist!")
 else
 call add()
 End If 
Catch ex As Exception MsgBox(ex.ToString)
 End Try 
End Sub 





Help needed urgently!!!

But this does not work for me, dont know how to fix, so can someone help


Thanks
Posted
Updated 7-Apr-12 9:26am
v2

1 solution

 
Share this answer
 
Comments
alom_93 7-Apr-12 19:32pm    
thanks for your input, but if what do i put in the 'do something' part? if it collects the rows -1 what should happen next? Display error?
alom_93 9-Apr-12 19:12pm    
can u help?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900