C# database driven website, VS2008 & MSSQL guidance request - c#

I need a bit of guidance or pointing towards some tutorials for storing webpage content within a database and for that data to be displayed as and when requested. I touched on storing data within grid views etc, but i cannot get my head around how i would store all the CSS and display alot of content in a web page style as opposed to grid view.
Whilst i understand the prinicples of the dynamic driven websites, i have been unable to find a real clear cut tutorial to guide me through the basic process. For e.g. should i use data entities, or a list view etc? I have my DB tables created, and my page layouts created i just need to store the data and call it when needed.
Any help would be greatly appreciated.

Why re-write something that has been done many times before? What you're looking for is a Content Management System; there are many to be had from free to costly, and I'm sure you could find something that would meet your needs.

Related

Data visualization from database

Im a newbie for such programming like reports/visualizations si I´m here just to ask for some advices, resources, tutorials..
The main goal of my new focus is to create custom charts/visualizations within really small time. Right now I have made some kinds of reports for Machines Overview, Machines Availability or OEE. These are made in MS SSRS (SQL Server Reporting Services). This kind of reports creating is pretty good, also very limited and not modern. The procedures in SQL server are already written and at least everything I have to do is transform these data to a newer modern design (kinda innovative internal business project)
I started studying ASP.NET MVC 2 months ago to create these charts as a web app. Searched hours for tutorials and videos on youtube, but there are no proper tutorial to visualize data directly from database. Found chart templates for MVC e.g.:
link: https://canvasjs.com/asp-net-mvc-charts/stacked-column-chart/
Here I can find the main source code for the whole chart but the values that´s being showed are strongly typed. I´m trying to figure out how to show exact values from database. I would like to know how to assign exact values for axis X and Y + values calculated from stored procedure.
In visual studio followed the instructions from various tutorials how to create WebForms, MVC website etc. Everywhere they were showing local/strongly typed values.
I need 1 solution for reports where everything is prepared in SQL, there just needs to be somehow connected from database to chart.
Like in the mentioned link there is a controller window where should be maybe some {get; set;} statement from database with same column name as in SQL DB.
We are using
SQL Server 2015
SQL Management studio 2015
SQL Server Reporting Services (SSRS)
MS ReportBuilder
the code to show can be expected in the mentioned link from canvas.js link for the whole MVC chart.
Reports:
I´m looking for a specific solution where I found specific charts (e.g.: canvas.js) what I have to edit and how, to use our data in specific charts. I´m interested in so bad because later in future my department will focus on creating custom specific charts for customer requirements.
Visualization:
Same goal as in Reports. Actually the visualization in production is just mentioned as "visualization" at least it´s just a report which has inside an html meta tag for 30sec autorefresh. I would like to know some other method where the data change could be asynchronous (I have heard something about React for this?)
If what you want is visualize data directly from database, you should look for a BI or business intelligence tool such as Power BI, SAS, SAP, etc.
If you plan to make them your own through a web app and you want to use ASP.NET MVC then you'd really have to study some Javascript, HTML, and MVC itself. What needs to happen is;
From your ASP.NET MVC web app, inside your Controller you need to get the data from the database. Search ADO.NET if you think Entity Framework might take some time.
Now that you have data in your Controller, it's time to pass them to the View. Search ViewBag or ViewData if don't want to use Strongly typed models.
Now that the data is inside the View, it's time to use Javascript or Jquery to loop through that data and pass them to the Charts javascript library you mentioned.
you can try dotnet Report builder https://www.dotnetreport.com and see if it works for your requirements. It’s very fast, installs with just a nuget package and some configuration. Sounds like exactly what you need. Full disclosure, I’m affiliated with the company.

C# Web Application Form using Stored Procedure

As a DBA/SQL Server Developer, I'm often asked to produce web pages where users can view the data in the database and edit them, and see the edits they've made straight away (without refreshing the page). I know nothing about ADO.NET or C#, but I would like to be able to give users this very simple functionality. Essentially I'm looking for three things:
to display a table of data in a webpage retrieved from a SQL Server stored procedure
to display a text box in the same webpage where users can input data
to display a button in the webpage that takes the inputted data from the text box, runs it through the stored procedure as a parameter, and refreshes the table.
Ideally I'd like this all to happen without the user having to refresh the webpage.
My questions are: is this kind of thing possible? How difficult is it to achieve? And how do I do it? I don't have the time to learn web development in full. I wouldn't need the vast majority of skills I'd learn even if I did learn it in full. I just really need this basic functionality, to produce ultra simple pages when user requests come in.
If anyone knows of any examples of just this kind of thing, that I can copy, they would be greatly appreciated!
You don't really need to use MVC, WebForms or even C# for that matter. Using one of those would be killing a ant with a rocket launcher.
Look into node.js and pug, using a RESTFUL API to deliver the information you need. I don't believe you will need more than two hours to provide your users with the interface you told us.
Node has a awesome package called express, it sets up everything for you and uses Pug on the starter template.
You can check out a tutorial right here.
Actually it will also take 2 hours doing with Webforms or MVC . I recommend using Entity Framework to make it super simple.
Webforms may be a bit older technology but will be faster to develop this specific page (assuming you only targeting Desktop users). Otherwise MVC is the way to go.
You can Check the tutorial.
https://learn.microsoft.com/en-us/aspnet/mvc/overview/getting-started/introduction/getting-started

How to write ASP.NET webform data to SQL

I am a total beginner of ASP.NET. I have created a webform in Visual Studio and now I need to figure out how to make the webform submit the data to a record in SQL. I assume there are thousands of tutorials out there for this but I can't seem to find any. Everything I find seems wildly over-complicated to just simply write data to a record. (or maybe its just my lack of understanding .NET that makes it seem over-complicated.)
I dont need to exchange data, or update live data on a page form the db, I just need to write the data to a record.
Can anyone point me in the right direction?
You could use the scaffolding feature to generate your application.
All you need to do is setup your connection string (pointing to your database) and follow this tutorial (http://www.c-sharpcorner.com/UploadFile/4b0136/getting-started-with-web-forms-scaffolding-in-Asp-Net/).
As simple as this!
Follow this link: http://mrbool.com/inserting-data-into-sql-server-database-using-csharp-and-asp-net/25091
or this link
http://www.c-sharpcorner.com/Blogs/12611/easy-steps-to-insert-data-into-sql-server-using-Asp-NetC-Sharp.aspx

Loading content from DB to aspx page based on URL

I'm currently trying to create a small scale CMS for my personal website and thought I'd like to try to make some sort of a page layout from a basic aspx file with some placeholders and load content based on the URL, without the use of url query strings such as ?pageid=1.
I'm trying to wrap my head around how this can be achieved without getting errors of a physical file not existing when I e.g. type in http://mywebsite.com/projects/w8apps/clock.
I've read a lot about BLOB and storing files binarily in the database. But I haven't come across a blog which points in the direction of using a so called page layout and loading content based on the URL instead of a query string.
I'm not asking for a solution, just some hints - blogs mostly - which can point me in the right direction and help me achieve this goal.
To deal with loading a page with a URL that is more friendly, rather than ?page_id=1, you may want to have a look at this article about URL Rewriting and URL Mapping.
http://www.codeproject.com/Articles/18318/URL-Mapping-URL-Rewriting-Search-Engine-Friendly-U
Hope you can find a way of fitting this kind of code into your application!
You questions is too broad but here are couple hints that will point you in the right direction.
Create clear specs before you start working on this. Do you really need to have URLs like this http://mywebsite.com/projects/w8apps/clock ? If yes then check out MVC since it has best support for this
Storing binary files in database doesn’t have much to do with this. You first need to think of how your tables will look like and that is based on what are you trying to achieve…
I’d suggest you install some CRM that if open source and analyze this first. You’ll probably find a lot better ideas this way. Just go to CodePlex and search for CMS.

Search engine optimization for database loaded using jQuery

I am currently optimizing my site for search engines. It is mainly a database driven site. I am using C# on the back end but database content is loaded via jQuery ajax and a web service. Therefore, my database content is not in html at the point that the bots will crawl it. My site is kind of like an online supermarket format in that there are thousands of items in my database, users can load a single one of these or more onto the web page at a time and the page does not change significantly once items are loaded.
My question is, how (if at all) can I get my database contents indexed? I was thinking of having an anchor that links to an aspx page (eg called mydatabase) which loads all of my database items as a big html list. Then, using jQuery, I would make the anchor invisible to users. The data would still be accessible to users but not by this link, it would be accessed by using the jQuery interface I have created.
The thing is, I don't really want users to see this big, messy list - would google results show this page eg www.mysite.com/mydatabase.aspx as a search result? Also would google see this as "keyword rich" spam page? I have done quite a lot of research but found nothing on this. only instructions for php. Please help I'm not sure what to do and need to know the best way to go about this.
It's a shame you haven't taken the progressive enhancement approach as it would mean you would have started with a standard HTML output that's crawlable, and then adding the layering behaviour (AJAX) on top for the user experience.
Providing a single file (e.g. mydatabase.aspx) that lists all of your products in a list format provides no real value for the reason you gave - it would just be a big useless list. No editorial content relevance for each link etc.
You're much better off taking another look at your information architecture and trying ensure that each product is accessibile by it's own unique URL, then classifying the products into groups (result pages), being careful to think about pagination.
You can still make this act like a single-page application using AJAX, but you'd want to look into HTML5's History API to achieve this in a search engine friendly way.

Categories