Can't get dataGrid to show correct information

When I upload a file to my server, it writes a record in the FILES table.  Then it goes thru some code and sets the info_id of that record to the the info_id of the last record in the INFO table.
My problem is that after this is done, I want the dataGrid on this page to show only the records in the FILES table that have the same info_id from record in the INFO table that is currently displayed on the page.  
Any ideas?

I can post that section of code if you want.
jettman26Asked:
Who is Participating?
 
TorrwinConnect With a Mentor Commented:
Dim myCommand as new SqlClient.SqlCommand
Dim myAdapter as new SqlClient.SqlDataAdapter
Dim myConnection as new SqlClient.SqlConnection
Dim myQuery as String

myConnection.ConnectionString = "Server=SERVER_IP_ADDRESS;initial catalog=DATABASE_NAME;uid=USER_ID;pwd=USER_PASSWORD;"
myCommand.Connection = myConnection

myQuery = "SELECT FILES.* FROM FILES, INFO WHERE FILES.INFO_ID = INFO.INFO_ID WHERE INFO.INFO.INFO_ID = '" & your_variable & "'"

myCommand.CommandText = myQuery
myAdapter.SelectCommand = myCommand
myAdapter.Fill(Dataset1, "Results")

DataGrid1.Datasource = Dataset1
DataGrid1.DataBind()
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.