Hello there,
I am in need of major help. I am trying to convert my ASP classic website to ASP.net. Now my problem is with reading and controlling of the data found in my SQL Server DB. I have managed to connecting to the database and read the records there and display them in a grid but I dont want that. Because of the design, my website requires me to place every field in its position and also use the Id of the record as a link to display more information of that record. In other words, I need to control each field of each record freely and place them at a position inside my default.aspx page as I please (meaning not by on Page Load or on click). I used to do this in classic ASP via recordset and Loop and then use it whereever I want and while calling on each field via the recordset. How can I do this in ASP.NET. For example convert the below code exactly as it is to ASP.net so that I can use freely. I have found many solution none of which works for me (gridview, dataadapter, etc.). The code is:
Function SetLanguage()
Dim Sql,rs,langStr,lId,lLanguage,RqstSession
RqstSession = Session("lngID") 'THIS COULD BE A VARIABLE SET AS FIXED OR PASSED ON TO THE SUB
langStr = "<select name="lang">"
set rs=Server.CreateObject("ADODB.recordset")
Sql="SELECT * FROM tblSystemLang WHERE lVisible = 1 AND lLimitations NOT LIKE '%<" & DeCrypt(Session("ClientId")) & ">%' ORDER BY lId ASC"
rs.Open Sql,Connection_Variable,3,1
while not rs.eof
lId =rs("lId")
lLanguage =rs("lLanguage")
if Cint(RqstSession) = Cint(lId) then
langStr = langStr & "<option value=""" & lId & """ SELECTED>" & lLanguage & "</option>" & VbCrlf
else
langStr = langStr & "<option value=""" & lId & """>" & lLanguage & "</option>" & VbCrlf
end if
rs.movenext
wend
rs.Close
set rs=nothing
set Sql=nothing
langStr = langStr & "</select>"
SetLanguage = langStr
End Function
Thanks
Awny