View Single Post
Old 06-24-2005, 10:10 AM   #3 (permalink)
grand_marquisGT
USAF .NET Slacker
 
grand_marquisGT's Avatar
 
Join Date: Feb 2005
Posts: 7
grand_marquisGT is on a distinguished road
Is there a way to do it in the code in VB.NET?

This is what im trying.
'Declaring the variables.
Dim dbCmd As New SqlClient.SqlCommand
Dim dbConn As New SqlClient.SqlConnection
Dim dbAdap As New SqlClient.SqlDataAdapter
Dim msg As String
Dim title As String
Dim style As MsgBoxStyle
Dim response As MsgBoxResult
msg = "Are you sure you want to delete this activity?" ' Define message.
style = MsgBoxStyle.DefaultButton2 Or _
MsgBoxStyle.Critical Or MsgBoxStyle.YesNo
title = "Fit For TEST" ' Define title.
' Display message.
response = MsgBox(msg, style, title)
If response = MsgBoxResult.Yes Then ' User chose Yes.
'lblDebug.Text = drgFit.DataKeys(e.Item.ItemIndex())
dbConn.ConnectionString = Me.Application("DB_CONN_STRING")
dbCmd.CommandText = "procFIT_Person_Activity_Del"
dbCmd.CommandType = CommandType.StoredProcedure
dbCmd.Parameters.Add("@PersonID", Utilities.Login.GetLoggedOnUser(Me))
dbCmd.Parameters.Add("@PersonActivityID", drgFit.DataKeys(e.Item.ItemIndex()))
dbCmd.Connection = dbConn
dbConn.Open()
dbCmd.ExecuteNonQuery()
dbConn.Close()
fill_drgFit()
End If

This is what I get:

It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

I think this has something to do with running a client side action, on a server side prog. what gives?
grand_marquisGT is offline   Reply With Quote