Connect asp.net(vb) to database in SQL Server
<p>I'm creating a login form in my asp.net page and my problem now is I don't know how to connect my asp.net (vb) to the SQL Server database.</p>

<p>I wanted to insert the connection code in the </p>

<pre><code>&lt;script runat="server"&gt; &lt;/script&gt;
</code></pre>

<p>Is this possible?</p>

<pre><code>&lt;%@ Page Language="VB" AutoEventWireup="false" CodeFile="Login.aspx.vb" Inherits="_Default" %&gt;
&lt;script runat="server"&gt;
    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        lblDate.Text = Format(Now, "MMMM dd,yyyy hh:mmtt")
    End Sub
&lt;/script&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
    &lt;link rel="icon" type="image/png" href="SENCOR_Logo.ico"&gt;
    &lt;title&gt;Auto OCS System&lt;/title&gt;
    &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;

&lt;/head&gt;
&lt;body&gt;
    &lt;div class="date_time"&gt;
    &lt;p&gt;&lt;asp:Label id="lblDate" runat="server" Text ="DateandTime"&gt;&lt;/asp:Label&gt;&lt;/p&gt;
    &lt;/div&gt;
    &lt;div id="wrapper"&gt;
    &lt;div class = "container"&gt;
        &lt;div class = "login"&gt;
            &lt;h1&gt;&lt;img src="SENCOR_Logo.jpg" height="35px;"&gt;&lt;/h1&gt;
            &lt;form method = "post" action = "" runat="server"&gt;
                &lt;p&gt;&lt;asp:TextBox id="txtUser" runat="server" placeholder="Username"/&gt;&lt;/p&gt;
                &lt;p&gt;&lt;asp:TextBox id="txtPass" runat="server" TextMode="Password" placeholder="Password"/&gt;&lt;/p&gt;
                &lt;p class = "remember_me"&gt;
                &lt;label&gt;
                &lt;label&gt;
                    &lt;asp:CheckBox id="chkRem" runat="server"/&gt;
                    Remember me on this computer
                &lt;/label&gt;
                &lt;/label&gt;
                &lt;/p&gt;
                    &lt;p class="submit"&gt;&lt;asp:Button id="btnLogin" Text="Login" runat="server" OnClick = "btnLogin_Click" /&gt;&lt;/p&gt;
            &lt;/form&gt;
        &lt;/div&gt;
        &lt;div class="login-help"&gt;
            &lt;p&gt;Forget your password? &lt;asp:HyperLink id="lnkRem" runat="server" Text="Click here to reset it." NavigateUrl ="~/Login.aspx"&gt;&lt;/asp:HyperLink&gt;&lt;/p&gt;
        &lt;/div&gt;
    &lt;/div&gt;&lt;/div&gt;
    &lt;div class="footer"&gt;
        &lt;p&gt;&amp;copy; 2016 Emilyn Pascua. All rights reserved.&lt;/p&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>