Writing a website with VB.NET back-end, no ASP.NET - sql-server

I've been asked to make a website with VB.NET server-side code, and I cannot use ASP.NET or any client-side scripting. The pages need to interact with a Microsoft SQL Server database hosted on a Windows 2003 server (which has IIS and the .NET framework installed). I've been googling for examples, but all the ones I find seem to be about ASP.
I have some basic PHP experience, and can program in VB.NET, but I've never had to do anything like this before. Can anyone give me a reference or basic example that I could play with that will help me connect an html webpage to the SQL database with VB.NET as my server-side code, without using ASP.NET?
Edit and clarification: I know ASP.NET is server-side - what I have been specifically banned from using is any tag starting <asp: or containing runat=server. If there are other features of ASP.NET that I can/need to use, then that's fine.

More specifically, I've been told I can't use any tags starting "<asp:" or containing "runat=server"
You can at least use IIS, and the .Net tools within IIS, right? You're not completely re-implementing a web server?
Just make a handler (*.ashx), and use Response.Write() ,<%=, and <%: for everything.
You should also look into whether you can use ASP.Net MVC (it doesn't need server controls at all). Otherwise you're essentially back in the dark days of classic asp.

ASP.NET is not client side.
ASP.NET is a web development framework which uses a server side language like C#/ Vb.NET. So what you are going to create is going to be an ASP.NET app with VB.NET as your codebehind language.
If you still do not want to use ASP.NET webforms framework to create a website but still like to use Vb.NET as the language, you may think about creating a WCF Service using VB.NET and Let your client non-asp.net web app consume it.
EDIT: After seeing your comment
I have been specifically banned from using is any tag starting
Consider ASP.NET MVC. There is no Server controls like what you have in webforms which has runat=server. You will be writing PURE HTML code and bind with some data as needed.

Well I suppose you could write a web server in VB.net that doesn't use ASP.net, but why?
Given you haven't had a specific restriction against using MVC, I'd look into that.

You don't necessarily have to use controls to make the website with ASP.NET. Use plain HTML and have your server side code just output text. Something like this:
<table>
<%= tableRow.toString() %>
</table>
You'll use a lot of string builders but it should accomplish what you're looking for.
MVC might be another alternative if you can persuade them that it's not actually doing any client side code. You're separating the HTML View (and any javascript if they're letting you use that) from the business logic and database logic.
Hope that helps some.

Related

SQL Server Database internal network Application

I have a SQL Server Database back-end. I want an internal network front-end UI, such that it is only accessible within a company network, not the web. Which platform would be best to use for a front-end UI application with a SQL Server database back-end? ASP.NET, PHP, Silverlight, or something else.
I would like to have graphs showing trends in data, and I would like to have the user to be able to select paramters on certain reports.
I do not have much experience with front-end user interfaces so I am open to just about anything.
If you need more information just let me know.
Thanks
If you want to build a front-end mainly for reports , I would suggest using SQL Server Reporting Services.
If you are really interested in having a better UI experience then i suggest you go with Silverlight .You wont get resizable layout ,grid and feature rich UI without using 3rd party tools in ASP.NET.
If you want your application to be used on any device than ASP.NET is the way to go since silverlight has some compatibility issue as you need to install plugin for it .So it all depends upon the requirement .No idea regarding PHP or any other technology

Silverlight 4 with SQLite or alternative

I am making a Silverlight app and what I considered something straight-forward really isn't.
I am in need to create a application where a local database is stored on the web server where the Silverlight application can connect to and whenever a user goes on the application will allow sql queries to be carried out. Main use is Registration, login and event registration.
I have tried the Community SQLite: http://code.google.com/p/csharp-sqlite/
But had trouble getting it to work with Silverlight, my guess is due to poor documentation. I already have made a project containing a lot of work so I just want to implement my SQLite code into that.
Can anyone help
Thanks.
If you want your Silverlight application to have a LOCAL storage database, check out Sterling.
If you want your Silverlight application to query a centralized, server-side database, then you need to expose your database via WCF. RIA services is probably the easiest implementation.

Using Subsonic 3.0 With Silverlight

I am writing a silverlight Line of business application and wanted to use the Subsonic DAL. The Silverlight Project will not allow me to Add the Subsonic reference with the followng error "You can not add the Subsonic.Core.Dll as it was not built against the Silverlight Runtime". I assume that I could create a webservice and add the Subsonic to that, but I would like to just add it to the Silverlight Project. Has anyone done this and if so how. If not is there an easy way to expose the DAL through the Webservice.
You don't want to access your database directly from your silverlight application. This will create a big security hole. Remember that the silverlight client runs on the clients machine and the traffic between the client and the server can easily be tampered with.
For easy access, to a server side API, you can try .NET RIA Services.
To clarify the error message: Silverlight is based on .net, but you can't just run any .net assembly in silverlight. This is because a lot of stuff in normal .net is simplified, not allowed or not supported in client-side silverlight, which makes binary compatibility difficult or even pointless.

Using Logging from Microsoft Application Block with WPF

I have a WPF application and I want to use the Microsoft Application Block for logging (MIcrosoft.Practices.EnterpriseLibrary.Logging)
How can I configure it in order to work?
It depends where and how you want to persist the log data.
Download the enterprise lib 4.1 from
http://msdn.microsoft.com/en-us/library/dd203099.aspx
There is quick start for logging. The app.config within the sample is what you are after.
You shouldn't have to make much change from it in order to make your WPF logging works.
FYI there's nothing special about using EntLib with a WPF application versus a WinForms or server application (assuming you're not launching forms for visual tracing).
MSDN has a document on this that should answer you question:
Integrating the Logging Application Block with WCF Applications
http://msdn.microsoft.com/en-us/library/ff648685.aspx

How to rearchitect Hibernate DAO layer of ASP.NET app to move it to Silverlight?

Last try to get an answer on this.
I have a simple ASP.NET app which uses Hibernate for data access.
GUI can call methods on Customer object like "CalculateTotalSumOfOrders()".
Lazy loading (even though it's not optimal) will work for me, and when Orders and OrderLines collections are referenced in the domain objects, they will get automatically fetched from the database.
Now let's assume I am rewriting the same very app to Silverlight because it looks better than ASP.NET.
I am NO longer able to do lazy loading or data access, because Silverlight client runs in the browser.
How can I solve this without thinking too much about what kind of service to use to get data into the Silverlight client?
Your best bet for supporting all of those platforms is to use a web service. There are many different flavors that you can choose from, .NET 2.0 Web Services (ASMX), WCF, REST, if you are using Silverlight, you may want to consider using WCF + LINQ to SQL which is demonstrated here. That combination can also be used in ASP.NET (if running on .NET 3.5) and Windows Desktop Apps (again .NET 3.5).
Also an open source project called InterLinq might be interesting to you, basically it allows you to build LINQ to SQL queries on the client side, and then transmit them through WCF to a server that executes the query and returns the result. That can be found here. I have experimented with it in the past and it works quite well.
One option that would support Silverlight and Windows clients would be the new ADO.NET Data Services in .NET 3.5 SP1. These are a set of services that expose your database schema through a WCF interface. You can then retrieve the data from Silverlight or a Windows Client using a WCF client.
As #McWafflestix has said, you won't be able to do lazy loading any more, but in my opinion that's a good thing because retrieving data is now a much more "expensive" operation.
You're trying to take a server-side app that interacts with your database and does lazy loading, and convert it into a client-side app without a lot of work? Sorry, it's just not going to work. What you need is a major rearchitecting of your application.
Sorry...
*
"That's okay because I'm quite early
there. How would you rearchitect it to
support both ASP.NET, silverlight and
windows clients with minimal
overhead?"
*
I know I am answering this question way past the expiry, anyhow here goes. I would suggest you use the MVP design pattern; this would help you build multiple "Views" to work with your Model. In order to ensure that you support Windows clients, you would have to expose your Business Layer using a services layer (read WCF).

Resources