By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,991 Members | 1,888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,991 IT Pros & Developers. It's quick & easy.

How to put prompt box in SelectedIndexChanged?

P: 29
Hi, i want to put a prompt box into my selectindexchanged section but i keep getting error.

I currently has this code (without the prompt box)

Dim row As GridViewRow = GridView1.SelectedRow
Dim str As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & Server.MapPath("database\db1.mdb")
Dim conn As New OleDbConnection(str)

If row.Cells(2).Text = "" Then
Dim mySelectQuery As String = "SELECT State, FileID FROM Table3"

Dim myUpdateQuery As String = "Update Table3 Set State='6' where FileID=" & "'" & row.Cells(1).Text & "'" & ""

Dim myConnection As New OleDbConnection(str)

Dim myCommand As New OleDbCommand(mySelectQuery, myConnection)

Dim myCommand2 As New OleDbCommand(myUpdateQuery, myConnection)

Dim retvalue As Integer

myConnection.Open()

myCommand2.ExecuteNonQuery()

Console.WriteLine(retvalue)

Dim myReader As OleDbDataReader

myReader = myCommand.ExecuteReader()


While myReader.Read <> 0

Label1.Text = ("Successfully Approve")

End While


myReader.Close()


myConnection.Close()
End If

How to i make it so that when i click on a select button, a box will show up asking me to continue or cancel.. Thank in advance.
Apr 19 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.