Hi there,
I couldn't agree with you more regarding the lack of documentation.
Rather than digging into your coding problem, let me tell you what I came up with. In this case, I retrieve one variable from a db and put it in a .aspx page. (VWD Express, VB)
Protected
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TidpunktHiddenField.Value = DateTime.Now
Dim serie = "A"
If Page.IsPostBack Then serie = SerieDropDownList.SelectedValue 'serie sätts
If Not Page.IsPostBack Then serie = "A"
Dim conn As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("wizzyConnectionString").ConnectionString)
Dim cmd As SqlCommand = New SqlCommand("SELECT TOP 1 vnr from products WHERE [fid]=1 AND [serie] = '" & serie & "' ORDER BY vnr DESC", conn)
conn.Open()
Dim id As String = cmd.ExecuteScalar
conn.Close()
VnrvardeLabel.Text = serie &
":" & id + 1
... etc (other pageload stuff).
And in the .aspx page, simply insert the label defined in the code above:
<
asp:Label ID="VnrvardeLabel" runat="server" Style="z-index: 102; left: 120px; position: absolute;
top: 120px"
Text="" ToolTip="Numret som satts.">
</asp:Label>
There are other things like ExceuteScalar if you need more than one value, but others would know more about those than I do.
Hope this helps!
Pettrer
Coding is a nine-to-five job: Nine PM to Five AM.