• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Website with SQL server

So he has a copy of Visual Studio, SQL Server and has his hosting setup for this and your advice is to try PHP and MySQL. Why?

Because (as I said at the start of my post), that's what the cool kids are doing.

Ultimately, it depends on why you are trying to do something. If you want to do something to play around with, then you choose the tools that you want to play with; if you want to do something which might be more usable or give relevant experience, then you choose the tools that offer that.

If you just want to use Visual Studio and SQL Server, then why bother making a web application for it? If you want to make a web application, why not use the tools that more people are using, which means that you can get more help when you need it?

I don't see Visual Studio and SQL Server as something that I would ever consider using for a website, but maybe that's just me.
 
So set up a free hosted site at Wordpress.com and write some .php extensions and plugins. There's a huge help library on there as well.

That's a bit like advising somebody seeking advice on providing management consultancy through a limited company to open a shop that sells pottery and run it through a limited liability partnership. The two things may both involve understanding how to manage people and take care of day-to-day operation of a business, but beyond that there's precious little similarity between them.

Similarly, somebody wanting to apply their existing knowledge of Microsoft web and database technologies would find only the most abstract benefit from working with WordPress*.

* There is a thing from Microsoft which allows WordPress to run on SQL Server (still reliant on PHP, of course) but it sounds like a massive hack: "the way the SQL Server patch is architected... is intercepting and re-writing MySQL queries" :eek
 
I'd agree with PHP and mySQL, just bang it together and it works. Cut this down from a much more complex page, so not sure it works as is but just to give you flavour of how simple it is. Press the button and it adds a record.

<?php
session_start();
$custid = session_id();

//open database
$con = mysql_connect("localhost","xxxxx","xxxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("xxxxxx", $con);

//add a record when submit is clicked
if (isset($_POST['add'])
{
$sql="INSERT IGNORE INTO shop (date, custid, silly) VALUES (NOW(), '$custid', 'nostrils')";
}

//stops post being done again and cart going up on refresh
header("Location: " . $_SERVER['REQUEST_URI']);
?>

<!DOCTYPE HTML>
<html>
<head>
<TITLE>Thing</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<form name="add" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
<input type="submit" name='add' value="Add to cart">
</form>

</body>
</html>
 
Last edited: 14:46
Personally I'd avoid these off the shelf free things. May seem simpler but if you want to do summit a bit different they are nightmares. Wordpress - yech! My sister had a professional do a Wordpress site for her. It took about 50s to load and when you looked at the content it was hardly surprising, masses of libraries to do very little.
 
Last edited: 14:52
Because (as I said at the start of my post), that's what the cool kids are doing.

Ultimately, it depends on why you are trying to do something. If you want to do something to play around with, then you choose the tools that you want to play with; if you want to do something which might be more usable or give relevant experience, then you choose the tools that offer that.

If you just want to use Visual Studio and SQL Server, then why bother making a web application for it? If you want to make a web application, why not use the tools that more people are using, which means that you can get more help when you need it?

I don't see Visual Studio and SQL Server as something that I would ever consider using for a website, but maybe that's just me.

Most websites that I've developed have been with Visual Studio, most have a DB. With the odd exception SQL server. I think VS + Sql server is an excellent choice for web development. ASP.NET MVC is an excellent and mature product. Visual Studio is arguably the best IDE out there. I'm struggling to understand your comment, my assumption is that you don't know anything about VS and SQL server.
 
I'd agree with PHP and mySQL, just bang it together and it works. Cut this down from a much more complex page, so not sure it works as is but just to give you flavour of how simple it is. Press the button and it adds a record.

<?php
session_start();
$custid = session_id();

//open database
$con = mysql_connect("localhost","xxxxx","xxxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("xxxxxx", $con);

//add a record when submit is clicked
if (isset($_POST['add'])
{
$sql="INSERT IGNORE INTO shop (date, custid, silly) VALUES (NOW(), '$custid', 'nostrils')";
}

//stops post being done again and cart going up on refresh
header("Location: " . $_SERVER['REQUEST_URI']);
?>

<!DOCTYPE HTML>
<html>
<head>
<TITLE>Thing</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<form name="add" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
<input type="submit" name='add' value="Add to cart">
</form>

</body>
</html>

Certainly quick and dirty.
 
Maybe we should ask what the host platform is. If thinking of using VS, presume it's Windows? VS (but not used it in web context) is certainly pretty brill IMO. Slickest dev tool going.
 
Last edited: 15:38
At the end of the day, all possible platforms are of high quality these days. But as the original question was about using Visual Studio, which implies one of the several variants of ASP.NET, and SQL Server, I don't think posts recommending PHP, MySQL, WordPress (which is just PHP and MySQL), or any other options are really on topic.
 

Advertisers

Back
Top