Server Error in '/Shobha@Web' Application.

The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value.

this is the error i am getting when tried to open a published page, which works fine with VS 2005 environment.

I have used something like this in the button click event. is there anything wrong here

I am newbie to .net. Kindly guide me.

Dim Dys(31) As Date

Dim DR As Data.SqlClient.SqlDataReader

Dim cmd As New Data.SqlClient.SqlCommand

Dim cn As New Data.SqlClient.SqlConnection

cn.ConnectionString = CWS_Ds.ConnectionString

cn.Open()

cmd.Connection = cn

cmd.CommandText = "select distinct(cdate) from cdates where month(cdate)=" & DDLmnth.SelectedIndex + 1 & " and year(cdate)=" & Val(txtYr.Text)

DR = cmd.ExecuteReader

Dim I, Cnt As Integer

While DR.Read

Dys(I) = DR(0)

I += 1

End While

DR.Close()

cnt=i

for i=0 to cnt+1

Dt = Dys(I)

Nd = New TreeNode

cmd.CommandText = "SELECT expr1 From vcalconfirm where cdate='" & Dt & "'"

cnfs = cmd.ExecuteScalar

Nd.Text = Format(Dt, "dd MMMM yyyy") & " (No. of Confirms : " & Cnfs & ")"




Answer this question

Server Error in '/Shobha@Web' Application.

  • Server Error in '/Shobha@Web' Application.