解析查询时出错。 [令牌行号= 1,令牌行偏移= 28,令牌错误= 2]

时间:2016-09-02 10:15:15

标签: c# sql asp.net insert-into

这是我所查看的错误,很难将其解释为我自己的代码。我希望你们中的一些人能够为我阐明这一点!

错误究竟意味着什么?

如何更改我的代码以解决错误?

    @{
var start = "";
var end = "" ;
if(IsPost){
    start = Request.Form ["start"];
    end = Request.Form ["end"];
        var db = Database.Open("StarterSite");
        var query = db.QuerySingle ("SELECT start FROM Holidays 2 where LOWER(start) = LOWER(@0)", start);
        if (query == null) {
        db.Execute("INSERT INTO Holidays 2 (start) VALUES (@0)", start);
        }
    }    
 }
<!doctype html>
<html lang="en">
<body>
<h1>Holidays</h1>
<table border="1" width="100%">
<tr>
<th>ID</th>
<th>Start Date</th>
<th>End Date</th>


<!--<tr>
<td>row.ID</td>
<td>row.datestart</td>
<td>row.datend</td>
</tr>  -->  

</tr>
</table>
<form method="post">
    <script>
  $(function() {
    $( "#datepicker" ).datepicker({
      dateFormat: 'dd/mm/yy',
      numberOfMonths: 1,
      showButtonPanel: true
    });
  });

   $(function() {
    $( "#datepicker1" ).datepicker({
      dateFormat: 'dd/mm/yy',
      numberOfMonths: 1,
      showButtonPanel: true
    });
  });
 </script>
    <div id="new">
    <form name="form1" method="post" action="holidays.asp?new=1"> 
    <table id="reqholstbl" name="reqholstbl">
    </br>
    <tr> Please ensure the Holidays you are requesting are in this calendar year only.</tr>
    <tr>
    <td id="col1">First day off:</td>
    <td id="col2">
    <input type="text" name="datestart" id="datepicker" value="@Request.Form["start"]" style="border:1px solid #999;"  />
    </td>
    </tr>
    <tr>
    <td id="col1">Last day off:</td>
    <td>
    <input type="text" name="datend" id="datepicker1" value="@Request.Form["end"]" style="border:1px solid #999;" />
    </td>
    </tr>
    <td id="col1">Comment:</td>
    <td><input type="text" style="border:1px solid #999;" name="comments"></td>
    </tr>
    <tr>
    <td id="col1"></td>
    <td><input name="Submit" type="submit" value="Submit" STYLE="WIDTH:80PX;"></td>
    </tr>
    </table>
    </form>
</div>
</div>
</form>
</body>
</html>

非常感谢任何帮助!

0 个答案:

没有答案