13:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.130 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 13:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.1313:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.13

.

.

Sunday, February 27, 2011

Basic Search & Chart Page - Razor Syntax (C#, C Sharp) - MS SQL Server 2008



Saturday, February 26, 2011

Working - Razor Syntax in C Sharp - Web-Based Database - Microsoft Server 2008























@if (!WebSecurity.IsAuthenticated) {
      Response.Redirect("~/Account/Login");
 }

@{
    Layout = "~/_SiteLayout.cshtml";
    PageData["Title"] = "Permitted Users Only";
}

@if ( Roles.IsUserInRole("power")) {
    <span> Welcome <b>@WebSecurity.CurrentUserName</b>! </span>
}
else {
     Response.Redirect("~/UnAuthorized");
}


@{
    var db = Database.Open("snakeConnection");
    var FName = Request["FName"];
    var MName = Request["MName"];
    var LName = Request["LName"];
    var RefBy = Request["RefBy"];
    var Age = Request["Age"];
    var Gender = Request["Gender"];
    var Street = Request["Street"];
    var City = Request["City"];
    var State = Request["State"];
    var Zip = Request["Zip"];
    var Phone1 = Request["Phone1"];
    var Phone2 = Request["Phone2"];
    var Email = Request["Email"];
    var DateVisit = Request["DateVisit"];
    var HABenefit = Request["HABenefit"];
    var BenefitYN = Request["BenefitYN"];
    var HABenWhom = Request["HABenWhom"];
    var IPA = Request["IPA"];
    var HMO = Request["HMO"];
    var CPTCode = Request["CPTCode"];
    var ICD9Code = Request["ICD9Code"];
    var GrossSale = Request["GrossSale"];
    var COGS = Request["COGS"];
    var TDate = Request["TDate"];
    var Brand = Request["Brand"];
    var Model = Request["Model"];
    var PayMethod = Request["PayMethod"];
    var PayPocketAmt = Request["PayPocketAmt"];
    var PayInsAmt = Request["PayInsAmt"];
    var WDamageB = Request["WDamageB"];
    var WDamageE = Request["WDamageE"];
    var WRepairB = Request["WRepairB"];
    var WRepairE = Request["WRepairE"];


    if (IsPost) {

        // Read product name.
        FName = Request["FName"];
        if (FName.IsEmpty()) {
           ModelState.AddError("FName", "First name is required.");
        }

        MName = Request["MName"];
        if (MName.IsEmpty())
        {
            ModelState.AddError("MName", "Middle name is required.");
        }

        // Read product description.
        LName = Request["LName"];
        if (LName.IsEmpty()) {
          ModelState.AddError("LName",
                "Last Name is required.");
         }

        // Read product price
        RefBy = Request["RefBy"];
        if (RefBy.IsEmpty()) {
          ModelState.AddError("RefBy", "Referred by is required.");
        }

        // Define the insert query. The values to assign to the
        // columns in the Product table are defined as parameters
        // with the VALUES keyword.
        if(ModelState.IsValid) {
            var insertQuery1 = "INSERT INTO dbo.Patients (FName, MName, LName, RefBy, Age, Gender, Street, City, State, Zip, Phone1, Phone2, Email) " +
                "VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11, @12)";
            db.Execute(insertQuery1, FName, MName, LName, RefBy, Age, Gender, Street, City, State, Zip, Phone1, Phone2, Email);
            var insertQuery2 = "INSERT INTO dbo.Referrals (LName, RefBy, DateVisit, HABenefit, HABenWhom, IPA, HMO, CPTCode, ICD9Code) " +
                "VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8)";
            db.Execute(insertQuery2, LName, RefBy, DateVisit, HABenefit, HABenWhom, IPA, HMO, CPTCode, ICD9Code);
            var insertQuery3 = "INSERT INTO dbo.financials (LName, GrossSale, COGS, TDate, Brand, Model, PayMethod, PayPocketAmt, PayInsAmt, WDamageB, WDamageE,   WRepairB, WRepairE) " + "VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11, @12)";
            db.Execute(insertQuery3, LName, GrossSale, COGS, TDate, Brand, Model, PayMethod, PayPocketAmt, PayInsAmt, WDamageB, WDamageE, WRepairB, WRepairE);
        }
    }
}


    <form method="post" action="">
    <table width="900" border="1">
    <tr>
    <td width="225"><h3 align="center">Patient</h3></td>
    <td width="225">
            <h3 align="center"><input type="submit" value="Submit" class="submit" style="color: Blue; width: 75; height: 35;"/></h3></td>
    <td width="225"><h3 align="center">Insurance</h3></td>
    <td width="225"><h3 align="center">Financials</h3></td>
    </tr>
    </table>
    <table width="900" border="1">
  <tr>
    <td width="150px">First Name</td>
    <td width="150px">
       <input type="text" name="FName" value="" />
      </td>
    <td width="150px">Date of Visit</td>
    <td width="150px"> <input type="text" name="DateVisit" value="" /></td>
    <td width="150px">Transaction Date</td>
    <td width="150px"><input type="text" name="TDate" value="" /></td>
  </tr>
  <tr>
    <td width="150px">Middle Name</td>
    <td width="150px"><input type="text" name="MName" value="" /></td>
    <td width="150px">Hearing Aid Benefit</td>
    <td width="150px"><input type="text" name="HABenefit" value="" /></td>
    <td width="150px">Gross Sale</td>
    <td width="150px"><input type="text" name="GrossSale" value="" /></td>
  </tr>
  <tr>
    <td width="150px">Last Name</td>
    <td width="150px"><input type="text" name="LName" value="" /></td>
    <td width="150px">Benefit By Whom</td>
    <td width="150px"> <input type="text" name="HABenWhom" value="" /></td>
    <td width="150px">COGS</td>
    <td width="150px"><input type="text" name="COGS" value="" /></td>
  </tr>
  <tr>
    <td width="150px">Referred By</td>
    <td width="150px"><input type="text" name="RefBy" value="" /></td>
    <td width="150px">Insurer</td>
    <td width="150px"><input type="text" name="HMO" value="" /></td>
    <td width="150px">Brand</td>
    <td width="150px"><input type="text" name="Brand" value="" /></td>
  </tr>
  <tr>
    <td width="150px">Birth Date</td>
    <td width="150px"><input type="text" name="Age" value="" /></td>
    <td width="150px">IPA</td>
    <td width="150px"><input type="text" name="IPA" value="" /></td>
    <td width="150px">Model</td>
    <td width="150px"><input type="text" name="Model" value="" /></td>
  </tr>
  <tr>
    <td width="150px">Gender</td>
    <td width="150px"><input type="text" name="Gender" value="" /></td>
    <td width="150px">CPT Code</td>
    <td width="150px"><input type="text" name="CPTCode" value="" /></td>
    <td width="150px">Payment Method</td>
    <td width="150px"><input type="text" name="PayMethod" value="" /></td>
  </tr>
  <tr>
    <td width="150px">Street</td>
    <td width="150px"><input type="text" name="Street" value="" /></td>
    <td width="150px">ICD9/10 Code</td>
    <td width="150px"><input type="text" name="ICD9Code" value="" /></td>
    <td width="150px">Out of Pocket</td>
    <td width="150px"><input type="text" name="PayPocketAmt" value="" /></td>
  </tr>
  <tr>
    <td width="150px">City</td>
    <td width="150px"><input type="text" name="City" value="" /></td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">Insurance Portion</td>
    <td width="150px"><input type="text" name="PayInsAmt" value="" /></td>
  </tr>
  <tr>
    <td width="150px">State</td>
    <td width="150px"><input type="text" name="State" value="" /></td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">WarrantyD Begin</td>
    <td width="150px"><input type="text" name="WDamageB" value="" /></td>
  </tr>
  <tr>
    <td width="150px">Zip</td>
    <td width="150px"><input type="text" name="Zip" value="" /></td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">WarrantyD End</td>
    <td width="150px"><input type="text" name="WDamageE" value="" /></td>
  </tr>
  <tr>
    <td width="150px">Phone1</td>
    <td width="150px"><input type="text" name="Phone1" value="" /></td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">WarrantyR Begin</td>
    <td width="150px"><input type="text" name="WRepairB" value="" /></td>
  </tr>
  <tr>
    <td width="150px">Phone2</td>
    <td width="150px"><input type="text" name="Phone2" value="" /></td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">WarrantyR End</td>
    <td width="150px"><input type="text" name="WRepairE" value="" /></td>
  </tr>
  <tr>
    <td width="150px">Email</td>
    <td width="150px"><input type="text" name="Email" value="" /></td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>

</table>
 </form>

more debugging

Server Error in '/Starter Site6' Application.

Must declare the scalar variable "@9".

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Must declare the scalar variable "@9".

Source Error:

Line 72:             var insertQuery2 = "INSERT INTO dbo.Referrals (LName, RefBy, DateVisit, HABenefit, HABenWhom, IPA, HMO, CPTCode, ICD9Code) " +
Line 73:                 "VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9)";
Line 74:             db.Execute(insertQuery2, LName, RefBy, DateVisit, HABenefit, HABenWhom, IPA, HMO, CPTCode, ICD9Code);Line 75:         }
Line 76:     }

Source File: c:\Users\edog\Documents\My Web Sites\Starter Site6\Data\EnterPatient.cshtml    Line: 74

Stack Trace:

[SqlException (0x80131904): Must declare the scalar variable "@9".]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +2030802
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5009584
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +215
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +987
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +178
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
   WebMatrix.Data.Database.Execute(String commandText, Object[] args) +122
   ASP._Page_Data_EnterPatient_cshtml.Execute() in c:\Users\edog\Documents\My Web Sites\Starter Site6\Data\EnterPatient.cshtml:74
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +68
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +156
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +76
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContext context) +249

more troubleshooting

Server Error in '/Starter Site6' Application.

The parameterized query '(@0 nvarchar(5),@1 nvarchar(6),@2 nvarchar(8),@3 nvarchar(7),@4 ' expects the parameter '@4', which was not supplied.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: The parameterized query '(@0 nvarchar(5),@1 nvarchar(6),@2 nvarchar(8),@3 nvarchar(7),@4 ' expects the parameter '@4', which was not supplied.

Source Error:

Line 69:             var insertQuery1 = "INSERT INTO dbo.Patients (FName, MName, LName, RefBy, Age, Gender, Street, City, State, Zip, Phone1, Phone2, Email) " +
Line 70:                 "VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11, @12)";
Line 71:             db.Execute(insertQuery1, FName, MName, LName, RefBy, Age, Gender, Street, City, State, Zip, Phone1, Phone2, Email);Line 72:             var insertQuery2 = "INSERT INTO dbo.Referrals (LName, FName, RefBy, DateVisit, HABenefit, HABenWhom, IPA, HMO, CPTCode, ICD9Code) " +
Line 73:                 "VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9)";

Source File: c:\Users\edog\Documents\My Web Sites\Starter Site6\Data\EnterPatient.cshtml    Line: 71

Stack Trace:

[SqlException (0x80131904): The parameterized query '(@0 nvarchar(5),@1 nvarchar(6),@2 nvarchar(8),@3 nvarchar(7),@4 ' expects the parameter '@4', which was not supplied.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +2030802
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5009584
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +215
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +987
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +178
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
   WebMatrix.Data.Database.Execute(String commandText, Object[] args) +122
   ASP._Page_Data_EnterPatient_cshtml.Execute() in c:\Users\edog\Documents\My Web Sites\Starter Site6\Data\EnterPatient.cshtml:71
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +68
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +156
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +76
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContext context) +249


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

Troubleshooting

Server Error in '/Starter Site6' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0128: A local variable named 'insertQuery' is already defined in this scope

Source Error:

Line 70:                 "VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11, @12)";
Line 71:             db.Execute(insertQuery, FName, MName, LName, RefBy, Age, Gender, Street, City, State, Zip, Phone1, Phone2, Email);
Line 72:             var insertQuery = "INSERT INTO dbo.Referrals (LName, FName, RefBy, DateVisit, HABenefit, HABenWhom, IPA, HMO, CPTCode, ICD9Code) " +Line 73:                 "VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9)";
Line 74:             db.Execute(insertQuery, LName, FName, RefBy, DateVisit, HABenefit, HABenWhom, IPA, HMO, CPTCode, ICD9Code);

Source File: c:\Users\edog\Documents\My Web Sites\Starter Site6\Data\EnterPatient.cshtml    Line: 72






Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

PHP Web Based Microsoft SQL Server 2008 Interface - About to Execute an SQL Statement

Friday, February 25, 2011

ASP.NET - aspx - page for data input and some code - In Progress


























<%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeFile="Copy of EnterData.aspx.vb" Inherits="_Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Welcome to All Ear Doctors Hearing Aids     &nbsp;&nbsp;
        <asp:Button ID="Button1" runat="server" Text="Enter"
            style="z-index: 1; left: 550px; top: 134px; position: absolute" />
    </h2>
    <table width="900" border="1">
    <tr>
    <td width="300"><h3 align="center">Patient</h3></td>
    <td width="300"><h3 align="center">Insurance</h3></td>
    <td width="300"><h3 align="center">Financials</h3></td>
    </tr>
    </table>
    <table width="900" border="1">
  <tr>
    <td width="150px">First Name</td>
    <td width="150px">
        <asp:TextBox ID="FName" runat="server" Width="150px"></asp:TextBox>
      </td>
    <td width="150px">Date of Visit</td>
    <td width="150px"> <asp:TextBox ID="DateVisit" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">Transaction Date</td>
    <td width="150px"><asp:TextBox ID="TDate" runat="server" Width="150px"></asp:TextBox></td>
  </tr>
  <tr>
    <td width="150px">Middle Name</td>
    <td width="150px"><asp:TextBox ID="LName" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">Hearing Aid Benefit</td>
    <td width="150px"><asp:TextBox ID="HABenefit" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">Gross Sale</td>
    <td width="150px"><asp:TextBox ID="GrossSale" runat="server" Width="150px"></asp:TextBox></td>
  </tr>
  <tr>
    <td width="150px">Last Name</td>
    <td width="150px"><asp:TextBox ID="RefBy" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">Benefit By Whom</td>
    <td width="150px"> <asp:TextBox ID="HABenWhom" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">COGS</td>
    <td width="150px"><asp:TextBox ID="COGS" runat="server" Width="150px"></asp:TextBox></td>
  </tr>
  <tr>
    <td width="150px">Referred By</td>
    <td width="150px"><asp:TextBox ID="Age" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">Insurer</td>
    <td width="150px"> <asp:TextBox ID="HMO" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">Brand</td>
    <td width="150px"><asp:TextBox ID="Brand" runat="server" Width="150px"></asp:TextBox></td>
  </tr>
  <tr>
    <td width="150px">Birth Date</td>
    <td width="150px"><asp:TextBox ID="Gender" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">IPA</td>
    <td width="150px"> <asp:TextBox ID="IPA" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">Model</td>
    <td width="150px"><asp:TextBox ID="Model" runat="server" Width="150px"></asp:TextBox></td>
  </tr>
  <tr>
    <td width="150px">Gender</td>
    <td width="150px"><asp:TextBox ID="Street" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">CPT Code</td>
    <td width="150px"> <asp:TextBox ID="CPTCode" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">Payment Method</td>
    <td width="150px"><asp:TextBox ID="PayMethod" runat="server" Width="150px"></asp:TextBox></td>
  </tr>
  <tr>
    <td width="150px">Street</td>
    <td width="150px"><asp:TextBox ID="City" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">ICD9/10 Code</td>
    <td width="150px"> <asp:TextBox ID="ICD9Code" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">Out of Pocket</td>
    <td width="150px"><asp:TextBox ID="PayPocketAmt" runat="server" Width="150px"></asp:TextBox></td>
  </tr>
  <tr>
    <td width="150px">City</td>
    <td width="150px"><asp:TextBox ID="State" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px"></td>
    <td width="150px">&nbsp;</td>
    <td width="150px">Insurance Portion</td>
    <td width="150px"><asp:TextBox ID="PayInsAmt" runat="server" Width="150px"></asp:TextBox></td>
  </tr>
  <tr>
    <td width="150px">State</td>
    <td width="150px"><asp:TextBox ID="Zip" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">Zip</td>
    <td width="150px"><asp:TextBox ID="Phone1" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">Phone1</td>
    <td width="150px"><asp:TextBox ID="Phone2" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">Phone2</td>
    <td width="150px"><asp:TextBox ID="Email" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">Email</td>
    <td width="150px"><asp:TextBox ID="TextBox13" runat="server" Width="150px"></asp:TextBox></td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
  <tr>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
    <td width="150px">&nbsp;</td>
  </tr>
 
</table>
 
</asp:Content>

Window - Dialog Box - Always On Top

PowerMenu - Power Menu - Application

It's immensely helpful when programming to look at code you've moved around and are transcribing to an IDE. The program above allows computer users & programmers to place a window on top of others.

D-Link Wireless Access Point DAP-2553 Setup Interface - Configuration - BEFORE YOU PROCEED, I SUGGEST YOU BUY A DIFFERENT BRAND - Many productive work hours have been lost due to this faulty access point
























If using a Windows machine:

1. Open Control Panel
2. Open Network and Sharing Center
3. Click ''Change adapter settings."
4. Double click on "Local Area Connection."

You should see this (picture below):






















5. Highlight "Internet Protocol Version 4 (TPC/IPv4)" & Click properties

6. Enter the values below:























7. Connect your D-Link Wireless Access Point to your PC with an Ethernet cable
8. Open up a web browser and type this into the URL address line: http://192.168.0.50
9. At the login page use these credentials: User Name: admin
*Note: the default password is blank and the default user name is admin.














10. Once you're logged into the access point, you can configure your device.

Note: I posted this because there appeared to be a problem configuring the access point following the instructions provided. I was unable to connect to the login portal following the instructions provided.

If you want to secure your access point, you have to login to the portal/interface and set an encryption password/network password.

Wednesday, February 23, 2011

SQL Constraints - Primary Key, Foreign Key, Linking Tables

CREATE TABLE Patients
(
PatientID IDENTITY(1,1) PRIMARY KEY CLUSTERED,
FName Char(25),
MName Char(25),
LName Char(25),
RefBy Char(75),
Age date,
Gender Char(2),
Street Char(100),
City Char(75),
State Char(2),
Zip Char(5),
Phone1 char(20),
Phone2 char(20),
Email char(20)
)


-------------------------------------------------------------------------------------------------------

CREATE TABLE Referrals
(
ReferralID smallint IDENTITY(1,1) PRIMARY KEY CLUSTERED,
PatientID smallint NOT NULL,
RefBy Char(35),
DateVisit date,
HABenefit smallint,
BenefitYN Char(2),
HABenWhom Char(35),
IPA Char(25),
HMO Char(75),
CPTCode Char(25),
ICD9Code Char(25)
CONSTRAINT fk_patientID
FOREIGN KEY (PatientID)
REFERENCES Patients(PatientID)
);

------------------------------------------------------------------------------------------------------

CREATE TABLE financials
(TransactionID smallint IDENTITY(1,1) PRIMARY KEY CLUSTERED,
PatientID smallint NOT NULL,
GrossSale money NOT NULL,
COGS money NOT NULL,
TDate date NOT NULL,
Brand char(25),
Model char(50),
PayMethod char(25),
PayPocketAmt money,
PayInsAmt money,
CONSTRAINT fk_patient
FOREIGN KEY (PatientID)
REFERENCES Patients(PatientID)
);

Friday, February 18, 2011

C++ Windows Form Application Initialization - Exercise To Build a Class Template (see bottom)

#pragma once

namespace HelpMeGod {

#include "ObjCell.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

/// <summary>
/// Summary for Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}

protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::TextBox^  txtOutput;
protected:
private: System::Windows::Forms::Button^  txtBox1;
private: System::Windows::Forms::TextBox^  txtOutput1;
private: System::Windows::Forms::TextBox^  txtOutput2;

private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->txtOutput = (gcnew System::Windows::Forms::TextBox());
this->txtBox1 = (gcnew System::Windows::Forms::Button());
this->txtOutput1 = (gcnew System::Windows::Forms::TextBox());
this->txtOutput2 = (gcnew System::Windows::Forms::TextBox());
this->SuspendLayout();
//
// txtOutput
//
this->txtOutput->Location = System::Drawing::Point(33, 76);
this->txtOutput->Name = L"txtOutput";
this->txtOutput->Size = System::Drawing::Size(97, 20);
this->txtOutput->TabIndex = 0;
//
// txtBox1
//
this->txtBox1->Location = System::Drawing::Point(33, 31);
this->txtBox1->Name = L"txtBox1";
this->txtBox1->Size = System::Drawing::Size(97, 23);
this->txtBox1->TabIndex = 1;
this->txtBox1->Text = L"Show Output";
this->txtBox1->UseVisualStyleBackColor = true;
this->txtBox1->Click += gcnew System::EventHandler(this, &Form1::txtBox1_Click);
//
// txtOutput1
//
this->txtOutput1->Location = System::Drawing::Point(33, 125);
this->txtOutput1->Name = L"txtOutput1";
this->txtOutput1->Size = System::Drawing::Size(97, 20);
this->txtOutput1->TabIndex = 2;
//
// txtOutput2
//
this->txtOutput2->Location = System::Drawing::Point(33, 177);
this->txtOutput2->Name = L"txtOutput2";
this->txtOutput2->Size = System::Drawing::Size(97, 20);
this->txtOutput2->TabIndex = 3;
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(284, 262);
this->Controls->Add(this->txtOutput2);
this->Controls->Add(this->txtOutput1);
this->Controls->Add(this->txtBox1);
this->Controls->Add(this->txtOutput);
this->Name = L"Form1";
this->Text = L"Form1";
this->ResumeLayout(false);
this->PerformLayout();

}
#pragma endregion
private: System::Void txtBox1_Click(System::Object^  sender, System::EventArgs^  e) {

HelpMeGod::ObjCell<>ethanInt(5);
txtOutput->Text = Convert::ToString(ethanInt.read());

HelpMeGod::ObjCell<double>ethanDouble(5.75);
txtOutput1->Text = Convert::ToString(ethanDouble.read());

HelpMeGod::ObjCell<bool>ethanBool(true);
txtOutput2->Text = Convert::ToString(ethanBool.read());
}
};
}

Thursday, February 17, 2011

Microsoft SQL Server - SQL Database - Trade Allocation by Investor - SQL Query With Inner Join















SELECT Investors.InvestorID, AllocationID, FName, LName, Street, City, State, Zip, AreaCode, Phone
FROM dbo.Investors INNER JOIN dbo.Trades
ON dbo.Investors.InvestorID = dbo.Trades.InvestorID




Microsoft SQL Server - SQL Database - Trade Allocation by Investor - SQL Query With Inner Join