Need query for findin next field from sql

cheruvannoor

Member
Joined
Aug 23, 2005
Messages
13
Programming Experience
Beginner
i want sample code for getting next field from sql.i had one query,but problem with that is suppose i had 5 entries,if i had deleted the 4th entrythen it wont move next from field '3'

My sample code is given below
query = "select * from branch where brbranchid= " & Txtkey.Text & " +1"

thanks and regards
cheruvannoor
 
if you want to get all the field names from your table then you can use the properties and methods of dataset object.

objdataset.tables("<tablename>").rows(0).item(<increment this value by 1>)

and you will get the names of your fieldnames.
 
in that case .net provides us the parameters collection object and you must avail of it as its a very easy to use object.

be more clear with the updation that you want, so that i can post you the excat code.
 
i am using buttons(first,next,previous and last) for displaying fields from sql
suppose i had deleted a particular field,then the table is not updating.Bcoz of that if i had deleted the 3rd field,by using
'next'button i cant move to 5th field.what can i do for that
 
i want to update my table after deletion
my sample code is given below



Private Sub Butndelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Butndelete.Click

If Txtkey.Text = "" Then
MsgBox("No Records To Be Deleted", vbExclamation, "System Validation")

Exit Sub
Else
If MsgBox("Are You Sure You Want To Delete This Record?", vbYesNo + vbQuestion, "Delete Confirmation") = 6 Then

Try

query1 = "delete from branch where brBranchId = " & Txtkey.Text & ""

myconn.CommandText = query1
myconn.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.ToString)
End Try



MsgBox("RECORD Deleted", 64, "SYSTEM MESSAGE")

End If
End If
 
Back
Top