hi iam getting error like "Conversion from string "0/" to type 'Double' is not valid." in the underline part of the coding ..........
here iam using sqlserver-2005

here my coding is

Protected Sub save_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles save.Click
 Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("guest1").ConnectionString())
        Dim booking_no, year, room_no, no_beds, amt, sino As Integer
        Dim date_of_arr, name, desig, dept, addr, date_of_dept, remarks, booked_by, booking_date As String
        Dim dt As Date
        dt = Date.Today

        If Len(sino) = 1 Then
            sino = "0000" + CStr(sino)
        End If
        If Len(sino) = 2 Then
            sino = "000" + CStr(sino)
        End If
        If Len(sino) = 3 Then
            sino = "00" + CStr(sino)
        End If
        If Len(sino) = 4 Then
            sino = "0" + CStr(sino)
        End If
      [U]  booking_no = CStr(year) + "/" + sino[/U]
 conn.Open()
        sino = sno.Text
        date_of_arr = dateofarrival.Text
        name = bookingname.Text
        desig = designation.Text
        dept = department.Text
        addr = address.Text
        room_no = roomno.Text
        no_beds = noofbeds.Text
        date_of_dept = dateofdeparture.Text
        remarks = purpose.Text
        booked_by = requestedby.Text
        booking_date = dateofbooking.Text
        Dim insert As New SqlClient.SqlCommand("insert into guesthouse(booking_no,date_of_arr,year,name,desig,dept,addr,room_no,no_beds,date_of_dept,amt,remarks,booked_by,booking_date,sino) values('" & booking_no & "' ,CONVERT(datetime,'" & date_of_arr & "',101),'" & dt.Year.ToString & "','" & name & "','" & desig & "','" & dept & "' ,'" & addr & "', '" & room_no & "','" & no_beds & "',CONVERT(datetime,'" & date_of_dept & "',101),'" & amt & "','" & remarks & "','" & booked_by & "',CONVERT(datetime,'" & booking_date & "',101),'" & sino & "')", conn)
        insert.ExecuteNonQuery()
        conn.Close()
        MsgBox("record saved")
    End Sub

pls give me the proper coding

Use & (string concatenation)

booking_no = CStr(year)  &  "/" &  sino
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.