Shodin

Hi all,

I'm wanting to use a database to hold the links for my link labels so they're easily updated should the link go bad. However, I'm not quite sure how to assign the URL in the database to the linklabel.

I've created the bindingsource and tableadapter, and currently have this set up in the code:
Me.SpGetLinksTableAdapter.Fill(Me._TEST_DataSet.spGetLinks)

I expanded the stored procedure spGetLinks and dragged the Link column onto the first linklabel. When I look at the properties for that linklabel and expand DataBindings it says spGetLinksBindingSource - Link.

However, I'm not sure what to do from here (or even if what I've done up to this point is correct).

Any ideas


Re: Visual Basic Express Edition Using a DB to define the URLs in a linklabel

Shodin

Hmm, I've usually received an answer by now. Is the question too difficult or do I need to elaborate more on what I'm trying to do




Re: Visual Basic Express Edition Using a DB to define the URLs in a linklabel

Shodin

Okay, here's where I'm at on this and I'm completely stuck.

I've bound the linklabel Tag property to the the binding source named spGetLinksBindingSource. However, it's only using the first record.

System.Diagnostics.Process.Start(Me.LinkLabel1.Tag)
System.Diagnostics.Process.Start(Me.LinkLabel2.Tag)
System.Diagnostics.Process.Start(Me.LinkLabel3.Tag)


So what I need to know is how do I move to the next record so the next link on the page will use the correct URL






Re: Visual Basic Express Edition Using a DB to define the URLs in a linklabel

Shodin

Okay, I FINALLY figured this thing out. Here's how I ended out doing it.

Dim LinksTable = Me.Sp_GetLinksTableAdapter.GetData()
For Each dr As _TESTDataSet.sp_GetLinksRow In LinksTable
Select Case dr("LinksID")
Case 1
Me.LinkLabel1.Tag = dr("Link")
Case 2
Me.LinkLabel2.Tag = dr("Link")
Case 3
Me.LinkLabel3.Tag = dr("Link")
Case 4
Me.LinkLabel4.Tag = dr("Link")
Case 5
Me.LinkLabel5.Tag = dr("Link")
End Select
Next