Problem Passing from asp.net to stored procedure

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=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:Insert
runat="server"
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" %>'
CreateDataSet="false"
SuccessURL='<%# "technology.html" %>'
FailureURL='<%# "Health.html" %>'
Debug="true"
>
  <Parameters>
    <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" />
  </Parameters>
</MM:Insert>
<MM:PageBind runat="server" PostBackBind="true" />

Open in new window

LVL 12
Nathan RileyFounderAsked:
Who is Participating?
 
ReecioConnect With a Mentor Commented:
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.
0
 
ReecioCommented:
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: http://www.aspnettutorials.com/tutorials/database/storedprocedure-vb.aspx
0
 
Nathan RileyFounderAuthor Commented:
Visual Web Developer? Yes I have it but not familiar with the functions.  How would I do it?
0
 
Nathan RileyFounderAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.