-1

hi,
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.

pls give me the code.
here iam using asp.net with vb.net
database is sqlserver-2005.
here my code is given below,,,

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
Votes + Comments
duplicate posts
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by kanuri1
-1

I didn't understand your problem. My observation is your code looks ok.

here probem is for exaple the data base field as like
room_no
1
2
3
4
5
if i wants to update in place of 3 as 6 it is possible
if i wants to update in place of 3 as 5(because 5 is already exits in the same field) ,originally it was not updated here,,but it was updated here...

so please give me the code

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.