#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    1
    Rep Power
    0

    Popup message in ASP.NET with data from SQL stored procedure


    Hi

    I am trying to show a popup message right after the user logs in and the data to be displayed in the pop up message has to come from stored procedure which I already have but do not know how show this data in the pop up

    The pop up can be simple with just a close button or a cross button on the right hand corner, the pop up would be just like an intimation to the user

    My application is in ASP.NET 3.5 and C# and the database I am using is SQL Server

    Thanks in advance
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    3
    Rep Power
    0
    Let What the Technocrab Developer think about this Problem Solution...




    obj.str = "select * from adminmaster where [a_user]='" + txtuser.Text + "' and [a_password]='" + TxtPass.Text + "'and[isexist]='"+1+"' and [block]= '"+0+"'and [req]='"+0+"'";
    obj.conn.Open();
    obj.cmd.Connection = obj.conn;
    obj.cmd.CommandText = obj.str;
    obj.dr = obj.cmd.ExecuteReader();
    if (obj.dr.Read())
    {
    Session["user"] = obj.dr["a_id"].ToString();
    Session["admin"] = obj.dr["type"].ToString();
    Session["load"] = "1";


    //If other information is showen, from SP than fire a SP and get data into a Data Table and pass it in alert msg
    Response.Write("<script language='javascript'>alert('Username :- " + abc + " Password :- " + Password + "')</script>");

    Response.Redirect("AfterAdminLogin.aspx");

    }
    else
    {
    //labMsg.Text = "Wrong Inputs..";
    }
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2014
    Posts
    1
    Rep Power
    0
    CREATE proc GetCustomers
    @CustomerID1 nvarchar (5),
    @CustomerID2 nvarchar (5)
    AS
    DECLARE @err_message nvarchar(255)

    --if no customers found return SEV 11 error to abort stored procedure
    IF NOT EXISTS (Select CustomerID from Customers where CustomerID = @CustomerID1 or CustomerID = @CustomerID2)
    BEGIN
    SET @err_message = @CustomerID1 + ' and ' + @CustomerID2 + ' Not found raise sev 11'
    RAISERROR (@err_message, 11,1)
    END

    --if 1st customerid not found throw SEV 10 exception
    IF EXISTS (Select CustomerID from Customers where CustomerID = @CustomerID1)
    BEGIN
    select * from Customers where CustomerID = @CustomerID1
    END
    ELSE
    BEGIN
    SET @err_message = @CustomerID1 + ' not found raise sev 10'
    RAISERROR (@err_message,10, 1)
    END

    --if 2nd customerid not found throw SEV 10 exception
    IF EXISTS (select * from Customers where CustomerID = @CustomerID2)
    BEGIN
    select * from Customers where CustomerID = @CustomerID2
    END
    ELSE
    BEGIN
    SET @err_message = @CustomerID2 + ' not found raise sev 10'
    RAISERROR (@err_message,10, 1)
    END
    \
    you can try the above code ny just giving your parameters. Raise error will raise an exception if id and password dont match with the data in database.
    Visit Us at:

    http://www.ati-erp.com

IMN logo majestic logo threadwatch logo seochat tools logo