i got an problem i wants to update the serialnumber in the database,
if i was updating the serial number as (for eg: 3 in place of 4), it was updated.
if i was updating the serial number as 3 in place of 4..
here serial number 3 is already in the database of same field and actually it was not updated.but here it was updated.
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("guest1").ConnectionString()) Dim adp As SqlDataAdapter Dim ds As New DataSet Dim SQL As String = "update guesthouse set room_no ='" & TextBox4.Text & "' where room_no='" & TextBox3.Text & "' and booking_no ='" & sino.Text & "'" conn.Open() Dim com As New SqlCommand(SQL, conn) com.ExecuteNonQuery() Label2.Text = " Room Is Changed" conn.Close() conn.Dispose() End Sub