ASP/Database problem (Long)

Hmm, OK try something else.

Place a breakpoint on the line:

codeStatus = codestatusAdapter.GetCodeStatus(CodeID)

Debug your code and when you go past that line when debugging, hover over the codeStatus text and click on the magnifying glass icon. It should say DataTable Visualizer.

This will show you what is in the dataset.
 
Sorry, it's the datarow not the datatable. :rolleyes:

When you debug past the codeStatusRow line, hover over the text then the plus sign, and you should see the word Table select the magnifying glass next to that.
 
Ok the DataSet visualiser shown the field CodeStatus and a value of 'In Progress' was in there.

That's a pretty good sign I suppose! Not that i've got a clue why it isn't working :D
 
Good, it's getting the data then :)

So what do you want to show in the textbox, the actual ID value or the status value?

What ever was displayed in the DataSet visualizer will be coming from your query GetCodeStatus(CodeID), so if in your query you haven't told it to show the ID field but only filter for a parameter then it won't find it.
In this case you would need to change your query to include the ID:
Code:
SELECT CodeID, CodeStatus FROM lward.tblCodes WHERE CodeID = (@CodeID)

However, if you want the status value in your textbox when you change the dropdown value e.g. 'In Progress' then change this:
Code:
TimeCodeStatusTextBox.Text = codeStatusRow("CodeID").ToString

To this:
Code:
TimeCodeStatusTextBox.Text = codeStatusRow("CodeStatus").ToString
 
Last edited:
Back
Top Bottom