Click here to Skip to main content
15,921,113 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a database,
SELECT TOP (1000) [ID_MainPage]
,[Link] ,[ApplicationName],[ResponsibleDepartment],[Contact]
,[Email],[Phone],[ID_Category],[Application_Description],[CategoryName]
FROM [T_app]

I want to display it on the database, ofcourse I can able to do that.
But, I would like to redirect to the webpage when i click on the ApplicationName, which means the link should be embedded to it.

Can I do it in sql server database?

What I have tried:

any help should be apperciated
Many thanks
Posted
Updated 15-Apr-20 3:41am

No, not really.
It's possible to do it for specific cases - if this is a website for example, you could wrap the executable name with the HTML for a link:
HTML
<a href="https://www.codeproject.com/">CodeProject - For those who code</a>
And you could embed that in your DB instead of "just the name". Then when it's displayed, teh browser generates a link automatically.

But ... that would only work on a web page - all you'd get on a WinForms app with be a bunch of HTML instead of the name.
And treh DB side should be completely independent of the presentation medium, which means storing HTML to solve a problem is a bad idea at best even if it does work for this app!

Instead, store the app name and a URL separately in two different columns of your DB, and get your presentation software to handle generating links from them. It'll save you a lot of heartache later!
 
Share this answer
 
Not really; as the database itself does not have anything to click on

What you really want to do is actually at the presentation level (aka User Interface) and how you embed the link is going to be directly dependent upon how you are generating that UI.

Quasi-code for doing something like this within a webpage would look like
rs = (execution of your select query)
	for each (row in rs)
		<a href="row[Link]">row[ApplicationName]</a>
	next
close rs
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900