Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9109473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:03:08+00:00 2026-06-17T03:03:08+00:00

I have to use vb6 Msgbox (vbyesno) in .net or something similar to that.

  • 0

I have to use vb6 Msgbox (vbyesno) in .net or something similar to that.
I know I can’t use Msgbox and I should use javascript but the problem is, I have to prompt that Messagebox based on the result of a query.

For example:

sql= "select * from users where position = 'manager' and id = '1'"
ds = getdataset(sql,db)
If ds.tables(0).rows.count > 0 Then
    If MsgBox("The user is a manager, are you sure you want to delete?", vbYesNo) = vbYes Then
        sql = "delete users where id = '1'"
    End if
End if

Is this somehow possible? Can I call javascript from the .net code or is there any other way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:03:09+00:00Added an answer on June 17, 2026 at 3:03 am

    Unfortunately No. You need to understand the concept of client-side and server-side programming.

    The select & delete portion is server-side programming, while the msgBox is client-side.

    What you want is to create a button on the webpage when rows.count > 0; then handle the buttonYES click even to delete the row.

    [Edit] I felt my response does not merit as an answer, so I’ve added a bit more details here:

    Create a webPage name deleteNow.aspx:

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="deleteNow.aspx.vb" Inherits="arrow_dynascreen.deleteNow" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="myForm" runat="server">
            Normal webpage content
            <asp:Panel ID="myConfirmationPanel" runat="server">
                The user is a manager, are you sure you want to delete?<br /><br />
                <asp:Button ID="btnConfirmationYes" runat="server" Text="Yes" />
                <asp:Button ID="btnConfirmationNo" runat="server" Text="No" />
            </asp:Panel>
        </form>
    </body>
    </html>
    

    Then, at the Code behind, do this:

    Public Class deleteNow   'Or a Partial Class, depending if you are on a WebSite or WebApplication
        Inherits System.Web.UI.Page
        Private Sub deleteNow_PreRender(sender As Object, e As System.EventArgs) Handles Me.PreRender
            myConfirmationPanel.Visible = False 'Set Default to always hide it.
    
            If Not IsPostBack() Then  'Only check to display confirmation if this is not a PostBack event (ie, when user click on Yes/No button, then don't check/execute this section.
                Dim sql As String = "select * from users where position = 'manager' and id = '1'"
                Dim ds As Data.DataSet '= Data.Sql.getda(sql, db)
                If ds.Tables(0).Rows.Count > 0 Then
                    myConfirmationPanel.Visible = True
                End If
    
            Else
                'Do other things that do not need to wait for confirmation
            End If
        End Sub
        Protected Sub btnConfirmationYes_Click(sender As Object, e As EventArgs) Handles btnConfirmationYes.Click
            'When user click on YES, this section will delete the SQL Row
            Dim sql = "delete users where id = '1'"
        End Sub
        Protected Sub btnConfirmationNo_Click(sender As Object, e As EventArgs) Handles btnConfirmationNo.Click
            'When user click on NO, this section will hide the confirmation panel (and do nothing).
            myConfirmationPanel.Visible = False
        End Sub
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a requirement to use VB6 generated dlls in .Net code but I
I must have a IDE for VB6. I can't use DotNet, because I cannot
I have some .NET code I use from VB6 code. I have always developed
I have a project with some C# dlls that use other vb6 dlls. I
i have written a lot of javascript functions that i want to use in
In .Net I can (and should) apply the FlagsAttribute to enums that are used
I have use semantic-analyze-proto-impl-toggle to switch between the function's proto and impl, but when
I have use the TryUpdateModel method on the controllers but now I need to
Hello I have use DOMDocs in the past but I am stuck how to
I am doing some maintenance on a VB6 Windows application. I have a .Net

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.