Problem Passing from to stored procedure

Posted on 2008-11-19
Last Modified: 2012-05-05
Below is the code I was trying to use to insert into a table in MS SQL server.  The host doesn't allow partially trusted connections though so this will not work.  I wanted to change the code to work with a stored procedure that I have written but I'm unfamiliar with .net.  The below code I made in dreamweaver with a server behavior.
<%@ Page Language="VB" ContentType="text/html" %>

<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=,publicKeyToken=836f606ede05d46a,culture=neutral" %>



CommandText='<%# "INSERT INTO dbo.Splash (name, zip, interest, ft, pt, interestlvl1, interestlvl2, interestlvl3, ""check"", phone, email) VALUES (@name, @zip, @interest, @ft, @pt, @interestlvl1, @interestlvl2, @interestlvl3, @check, @phone, @email)" %>'

ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_nathan") %>'

DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_nathan") %>'

Expression='<%# Request.Form("MM_insert") = "signup" %>'


SuccessURL='<%# "technology.html" %>'

FailureURL='<%# "Health.html" %>'




    <Parameter Name="@name" Value='<%# IIf((Request.Form("name") <> Nothing), Request.Form("name"), "") %>' Type="VarChar" />

    <Parameter Name="@zip" Value='<%# IIf((Request.Form("zip") <> Nothing), Request.Form("zip"), "") %>' Type="VarChar" />

    <Parameter Name="@interest" Value='<%# IIf((Request.Form("interest") <> Nothing), Request.Form("interest"), "") %>' Type="VarChar" />

    <Parameter Name="@ft" Value='<%# IIf((Request.Form("ft") <> Nothing), Request.Form("ft"), "") %>' Type="VarChar" />

    <Parameter Name="@pt" Value='<%# IIf((Request.Form("pt") <> Nothing), Request.Form("pt"), "") %>' Type="VarChar" />

    <Parameter Name="@interestlvl1" Value='<%# IIf((Request.Form("radiosite1") <> Nothing), Request.Form("radiosite1"), "") %>' Type="VarChar" />

    <Parameter Name="@interestlvl2" Value='<%# IIf((Request.Form("radiosite2") <> Nothing), Request.Form("radiosite2"), "") %>' Type="VarChar" />

    <Parameter Name="@interestlvl3" Value='<%# IIf((Request.Form("radiosite3") <> Nothing), Request.Form("radiosite3"), "") %>' Type="VarChar" />

    <Parameter Name="@check" Value='<%# IIf((Request.Form("check") <> Nothing), Request.Form("check"), "") %>' Type="VarChar" />

    <Parameter Name="@phone" Value='<%# IIf((Request.Form("phone") <> Nothing), Request.Form("phone"), "") %>' Type="VarChar" />

    <Parameter Name="@email" Value='<%# IIf((Request.Form("email") <> Nothing), Request.Form("email"), "") %>' Type="VarChar" />



<MM:PageBind runat="server" PostBackBind="true" />

Open in new window

Question by:N R
    LVL 4

    Expert Comment

    Do you have Visual Studio? The wizard is very easy to follow and you can specify the controls directly that link to the variables in your stored procedure.

    This link may help you understand a bit better:
    LVL 11

    Author Comment

    by:N R
    Visual Web Developer? Yes I have it but not familiar with the functions.  How would I do it?
    LVL 4

    Accepted Solution

    When you add an SqlDataSource you just hover over the control (In design view) and a right arrow will appear.
    Click this and select configure data source, a wizard will appear asking you to select the connection string (There will automatically be options on the pulldown if you have specified this in the web.config)

    Once you've selected the appropriate connection string, hit next and you'll be presented with the query builder. There is an option there to specify your own query or used a stored procedure, select this and hit next.
    You should be able to pick from a list of stored procedures found on your server from the stored procedures pull down list. If the stored procedures check box is not selectable, check the security level of your log in ID, if it has permission for stored procedures they will be shown.
    LVL 11

    Author Comment

    by:N R
    Ah yeah I see that now.  Still having some issues though.  What's the best way to do this?  On my index.aspx page I have a form.  After filled out and hit submit it takes me to robot.aspx page with all the values from the previous form showing up in the address bar.  How would I collect them from there?  Do  I need to add the sqldatasource on that page to grab them?  Or do I need it on index.aspx so it will collect when they hit submit.  I have tried but now seeming to work.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now