The conversion of a varchar data type to a smalldatetime data type resulted in an out-of-range value code is as follows:
Imports System.Data Imports System.Data.SqlClient Partial Class _Default Inherits System.Web.UI.Page Dim adap As SqlDataAdapter Dim cn As SqlConnection Dim cmd As SqlCommand Dim ds As DataSet Dim dt As DataTable Dim str, constr As String Dim rdr As SqlDataReader Dim errmsg As String Dim erflag As Boolean Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick If (dsr_no1.Visible = True) Then cn = New SqlConnection() cn = New System.Data.SqlClient.SqlConnection() cn.ConnectionString = "Data Source=PANKAJ\PANKAJSQL;Initial Catalog=Database;Integrated Security=True" cn = New SqlConnection(Application("constr")) cn = New SqlConnection() cn = New System.Data.SqlClient.SqlConnection() cn.ConnectionString = "Data Source=PANKAJ\PANKAJSQL;Initial Catalog=Database;Integrated Security=True" Dim i As Integer i = dsr_no.Text While (i < Val(dsr_no.Text) + Val(Quantity.Text)) cn = New SqlConnection() cn = New System.Data.SqlClient.SqlConnection() cn.ConnectionString = "Data Source=PANKAJ\PANKAJSQL;Initial Catalog=Database;Integrated Security=True" cn = New SqlConnection(Application("constr")) cn = New SqlConnection() cn = New System.Data.SqlClient.SqlConnection() cn.ConnectionString = "Data Source=PANKAJ\PANKAJSQL;Initial Catalog=Database;Integrated Security=True" str = "insert into dsr_main values (" + i.ToString + "," str = str + "'" + Location.Text + "'," str = str + "'" + Remarks.Text + "'," str = str + "'" + Date.Today.ToShortDateString + "'," str = str + "'" + Application("username") + "'," str = str + Val(ds