Hello
I want to display information in my database, not in a datagrid or other control, but in an HTML page.
What is the easiest way of achieving this?
Thanks
Printable View
Hello
I want to display information in my database, not in a datagrid or other control, but in an HTML page.
What is the easiest way of achieving this?
Thanks
Depends what the information you are trying to display is. Normally, if you want information from your DB, you would write an ASP/ASP.NET page to access the relevant information and display it.
You would then place a web browser control on a form and use the navigate method to go to the page you created.
HTH :D
Dim oProcess As Process
oProcess.Start("http://www.vbforums.com")
You could just use the streamwriter to create a html file from the data from your db. Then use the process object to start it in a browser.
Drop winforms and move to webforms instead.
Hello RobDog, this is exactly what I need to do...but HOW? I have a HTML file in a IsolatedStorage and want to show it in the browser. Which method would be suitable?Quote:
Originally Posted by RobDog888
Thank you a lot.
Ravie.
:)VB Code:
Dim oProcess As Process oProcess.Start("C:\MyFile.htm")
Thank you, RobDog. Unfortunately, I do not know the file's path, because it is stored in Isolated storage mode:Quote:
Originally Posted by RobDog888
Dim writer as new StreamWriter (New IsolatedStorageFileStream("ia.htm", FileMode.Create, isostore))
writer.writeline....
writer.close()
Is there a way around this?
Thank you very much.
Ravie
You could use a browser control in your own app rather than spawning an external process. If you have the HTML code in a string then you can assign it to the DocumentText property of the WebBrowser control. If you're using .NET 1.x (please specify in future) then I'd imagine that the ActiveX Web browser would have something similar.
Hello jmcilhinney,
I'm using .NET 1.x, but as I am not very experienced in VS.2003, I'd need something simple, if possible, or an example :). I just realised that even the RobDog's solution is not suitable for this, because I am developing a Sharepoint WEb Part and even when using oprocess.Start("C:\file.htm") I get a web part error, damn it :-/.
I fear I'll have to learn how to debug web parts :-)
Thank you very much.
Ravie
I have no idea how Web Parts work. Having read your first post again I realise that my suggestion violates your "other control" condition anyway.
Allow me to gracefully repeat myself: Use webforms. In other words, use ASP.NET. Unless that is what you are already using in which case you should have mentioned this earlier.
I am guessing that you are already using ASP.NET, because you've mentioned SPS Webparts, and are looking to display some information from a database. You have many options to do so, you only need to read up on some ADO.NET and you can use gridviews/datagrids to display the information.
Hello Mendhak,Quote:
Originally Posted by mendhak
I don't need to use datagrids and stuff like that, because I have to print a formatted output. This is why I use HTML. Other option would be to use MS Word - but I am not sure whether Word can be forced to import html code via VS.NET.
Thank you.
Ravie.
How is Webparts related to this then? You say you're getting a web parts error, explain that again in more detail.
I am getting the data from the DB into a Web part. The Web parts are difficult to debug, so I am working via "build-display web part-edit code-build-display...", so the Web Part either works correctly or throws an unspecified error.Quote:
Originally Posted by mendhak
I need to open an HTML code, which I have in a web part String variable, in a new browser window - that's all, but it doesn't seem to be simple at the moment :ehh: