Ok. I'm very confused as to whats going on here. I'm still a bit new to .Net and DNN, so please bear with me. I'm developing a new module for DNN. I've been able to get everything working properly so far, but this part has baffled me for literally two days now. I'm creating a vendor module for a client and in the vendor details page, I have 6 different checkboxes marking the 6 different locations the vendor could be attached to. In the db, I have a many-tomany table taht matches each possible location to its vendor and I'm running a sp to pull those according to the vendor's id number. Now, if this was classic asp, I woulda had it done in a matter of minutes because I have done this same thing many many times. So what I need is for each cckbox, loop through the pulld data result and check the checkbox's value against that paticular record row. Say something like this: for i=0 to 5
if the row value = the checkbox value, mark the checkbox as checked
next No the loops is not problem, I just cn't figure out how to get the stinkin data set so I can loop through it. I have tried creating arraylists and generic lists, but everything I find says to do it like this:
KochAirVendorManagerController objLocations = newKochAirVendorManagerController(); KochAirVendorManagerInfo objLocationsInfo = objLocations.GetLocationsByVendor(vendorId); ArrayList LocationsArray = newArrayList();while (objLocationsInfo.Read())
{
LocationsArray.add(objLocationsInfo("FieldName"));
} But everytime I do I get an error saying it doesn't contain a definition for 'read' and that I might be missing an assembly reference. Further investigations shows I probabaly AM missing the System.Data.SqlClient namespace. So I add it and I get an error saying that System.Data does not contain the SqlClient namespace, and I might be missing ANOTHER reference. So I investigate further and I find that I need to reference the System.Data.dll. BUT I ALREADY AM!! What the heck am I doing wrong? Is there another way to do what I am wanting to do here? Datalists, datagrids and about any other control I can find don't seem to be the solution. I just need to step through data in some way but Ic an't seem to get it into a form that I can step through. I'm about to bust out the cassic asp and throw it n there to make it work!!! PLEASE! |