Sorry for keep posting about the same question . Im still newbie in this language . So this is my problem . I keep got this error whenever i change the code many times . so this is my code
<tr>
<td style="width: 160px">
<asp:Label ID="Label2" runat="server">tarikh mula (mm/dd/yy) :</asp:Label>
</td>
<td>
<asp:TextBox ID="txtDate" runat="server" ReadOnly="true"></asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender1" TargetControlID="txtDate" runat="server">
</cc1:CalendarExtender>
</td>
</tr>
And this is my code behind
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Dim thisConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("SecurityTutorialsConnectionString").ConnectionString)
'Create Command object
Dim nonqueryCommand As SqlCommand = thisConnection.CreateCommand()
Try
' Open Connection
thisConnection.Open()
' Create INSERT statement with named parameters
nonqueryCommand.CommandText = "INSERT INTO QuotationBG (TajukSebutHarga, NoRujukan, TarikhMula) VALUES (@TajukSebutHarga, @NoRujukan, @TarikhMula)"
' Add Parameters to Command Parameters collection
nonqueryCommand.Parameters.Add("@TajukSebutHarga", SqlDbType.VarChar, 255)
nonqueryCommand.Parameters.Add("@NoRujukan", SqlDbType.VarChar, 255)
nonqueryCommand.Parameters.Add("@TarikhMula", SqlDbType.Date).Value = DateTime.Parse(txtDate.Text)
nonqueryCommand.Parameters("@TajukSebutHarga").Value = txtTS.Text
nonqueryCommand.Parameters("@NoRujukan").Value = txtNo1.Text + txtNo2.Text + txtNo3.Text + txtNo4.Text
nonqueryCommand.ExecuteNonQuery()
Finally
' Close Connection
thisConnection.Close()
End Try
End Sub