Setting bgcolors defined in a db

Results 1 to 2 of 2

Thread: Setting bgcolors defined in a db

  1. #1
    Join Date
    Dec 1969

    Default Setting bgcolors defined in a db

    I have a table (called cfg_config) in an sql-db, which resides colorcodes like "#f3f3f3" to be used as background color in the bodytag, table headings, font colors and so on. The code on my page goes like this:<BR><BR>Sub Page_Load(obj As Object, e as eventargs)<BR> BindData()<BR>End Sub<BR><BR>Sub BindData()<BR> Dim myConn as New SqlConnection(ConfigurationSettings.AppSettings("o Conn"))<BR> <BR> Const strSQL as String = "CFG_getConfig"<BR> Dim myComm as New SqlCommand(strSQL, myConn)<BR> <BR> myConn.Open()<BR> bodytag.attributes.add("bgcolor", "#f3f3f3")<BR>End Sub<BR><BR>I know how to hardcode the color as seen above, but when i try to replace "#f3f3f3" with some code from the db, i get an error. Can someone tell me how to do this right... How should the following sentence look like?<BR>bodytag.attributes.add("bgcolor", &#060;what code here?&#062;)<BR><BR>Thanks in advance...

  2. #2
    Join Date
    Dec 1969

    Default RE: Setting bgcolors defined in a db

    You need an object to read the data out for you.. A datareader.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts