Help with DataTable and DataRow in WebForm.aspx

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to accomplish the following task in WebForm.aspx

I have a SQL SELECT query that INNER JOIN two tables (Device_Tbl and Detail_Tbl) which will return
Device_BtnID Status Z_Index Left_Px Top_Px On_Img Off_Im
ImgBtnLight 0 102 192px 72px image\light_on.gif image\light_off.gi
ImgBtnAC 0 102 192px 72px image\ac_on.gif image\ac_off.gi

Based on the return result, I would like to something like this
Dim status As Boolean = dr("Status"
Dim img As Strin
If (status = False) The
img = dr("Off_Img_File"
ElseIf (status = True) The
img = dr("On_Img_File"
End I

imgA.ID = dr("Device_BtnID"

With img
.ImageUrl = im
.Attributes("style") = "Z-INDEX:" & dr("Z_Index") & "; LEFT: " & dr("Left_Px") & "; POSITION: absolute; TOP:" & dr("Top_Px"
End Wit

Panel1.Controls.Add(imgA

I wrote the above codes to load the image for the image button according to its on/off status as well as its coordinate on the WebForm.aspx from the database. However it is working for just one image button. I would like to load lots of image button based on the data return from the SELECT query. Therefore before the end of data reutn from the query, I would like to do the same thing as above. Can anyone please help me on this issue

I used DataReader to load one image button, I wonder should I use DataReader or DataAdapter if loading lots of image buttons. In additon, how to loads the tables (Inner Join two tables) from the query to DataTable?

Thanks
Ester
 
Hi Esther,

In my opinion you should have as much button pages available as there are
buttons on the currentscreen from that particular user.

When you have not so much buttons than you can maybe better make for every
page standard an immage page. This approach you are taking now will be very
nice however I think as well resources consuming.

And do not forget to test what your application does when there are more
users active.

I hope this helps anyhow?

Cor
 
Hi Ester,

This row from my clock sample.
Response.Cache.SetExpires(DateTime.Now.AddTicks(500))


That you need in my opinion definitly in your application.

Cor
 
Back
Top