Click here to Skip to main content
15,902,112 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: url cannot be access Pin
Not Active22-Jun-10 9:41
mentorNot Active22-Jun-10 9:41 
AnswerRe: url cannot be access Pin
Sandeep Mewara22-Jun-10 11:02
mveSandeep Mewara22-Jun-10 11:02 
GeneralRe: url cannot be access Pin
netJP12L22-Jun-10 15:16
netJP12L22-Jun-10 15:16 
GeneralRe: url cannot be access Pin
Sandeep Mewara22-Jun-10 20:00
mveSandeep Mewara22-Jun-10 20:00 
QuestionHelp me to Learn ASP.NET Pin
mwaqas199022-Jun-10 9:01
mwaqas199022-Jun-10 9:01 
AnswerRe: Help me to Learn ASP.NET Pin
netJP12L22-Jun-10 9:08
netJP12L22-Jun-10 9:08 
AnswerRe: Help me to Learn ASP.NET Pin
Dr.Walt Fair, PE22-Jun-10 10:39
professionalDr.Walt Fair, PE22-Jun-10 10:39 
QuestionPassing Parameters to a Stored Procedure (in C# NOT VB) Pin
DRAYKKO22-Jun-10 7:57
professionalDRAYKKO22-Jun-10 7:57 
I'm having some problems getting my stored procedure to see th parameters I'm passing in. The parameters are retrieved from a web form, and seen to be successfully send to the data access tier, but when I run the code I get the following exception:

"Procedure or Function 'stbFormPropertiesToXML' expects parameter '@displayMode', which was not supplied. "

The code is:
DisplayMode = dMode;
FolderAlias = _folderAlias;
SqlConnection conn = new SqlConnection(@"Data Source= .;Initial Catalog=MXContact.NET_Demo_100401;Integrated Security=true;");

SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "stbFormPropertiesToXML";    //stored procedure
SqlDataAdapter frmDA = new SqlDataAdapter(cmd.CommandText, cmd.Connection);
DataSet FormPropertiesDS = new DataSet();

try
{
    conn.Open();
    cmd.Parameters.Add(new SqlParameter("@displayMode", SqlDbType.NVarChar));
    cmd.Parameters["@displayMode"].Direction = ParameterDirection.Input;

    cmd.Parameters.Add(new SqlParameter("@folderAlias", SqlDbType.NVarChar));
    cmd.Parameters["@folderAlias"].Direction = ParameterDirection.Input;


    cmd.Parameters["@displayMode"].Value = DisplayMode;
    cmd.Parameters["@folderAlias"].Value = FolderAlias;

    cmd.ExecuteNonQuery();
    frmDA.Fill(FormPropertiesDS);
    conn.Close();

    FormPropertiesDS.WriteXml("FormProperties.xml");
    //FormPropertiesDS.WriteXml(MapPath("FormProperties.xml"));
}
catch (Exception ex)
{
    errorMsg = ex.Message;
}
finally
{
    conn.Close();
}


Where DisplayMode and FolderAlias are the parameters I'm trying to pass into the SP. The SP is defined as:

ALTER PROCEDURE [dbo].[stbFormPropertiesToXML]
@displayMode NVARCHAR(2),
@folderAlias NVARCHAR(30)

AS

SELECT	*
FROM	[stbFormProperties]
WHERE	[FolderKey]		=	(SELECT [FolderKey] FROM [stbFolders] WHERE [FolderAlias] =	@folderAlias)
AND		[DisplayMode]	=	@displayMode


I've been eearching the web for articles for the past serveral hours; so a second pair of eyes would be a big help.

DRAYKKO
=======================
Every experience in life is a lesson to be learned

A. Stevens
B.S., Computer Science

AnswerRe: Passing Parameters to a Stored Procedure (in C# NOT VB) [modified] Pin
Not Active22-Jun-10 8:20
mentorNot Active22-Jun-10 8:20 
GeneralRe: Passing Parameters to a Stored Procedure (in C# NOT VB) Pin
DRAYKKO22-Jun-10 8:28
professionalDRAYKKO22-Jun-10 8:28 
AnswerRe: Passing Parameters to a Stored Procedure (in C# NOT VB) Pin
Adam R Harris22-Jun-10 11:13
Adam R Harris22-Jun-10 11:13 
QuestionTab control within Tab Control Pin
indian14322-Jun-10 7:46
indian14322-Jun-10 7:46 
AnswerRe: Tab control within Tab Control Pin
Sandeep Mewara22-Jun-10 11:16
mveSandeep Mewara22-Jun-10 11:16 
QuestionUpdatePanel prevents javascript from getting latest value from a control Pin
Adam Brown 322-Jun-10 7:29
Adam Brown 322-Jun-10 7:29 
AnswerRe: UpdatePanel prevents javascript from getting latest value from a control Pin
Not Active22-Jun-10 8:11
mentorNot Active22-Jun-10 8:11 
GeneralRe: UpdatePanel prevents javascript from getting latest value from a control Pin
Adam Brown 322-Jun-10 9:39
Adam Brown 322-Jun-10 9:39 
GeneralRe: UpdatePanel prevents javascript from getting latest value from a control Pin
Not Active22-Jun-10 9:55
mentorNot Active22-Jun-10 9:55 
QuestionJavascript Print Function is not working Pin
jintalPatel22-Jun-10 6:18
jintalPatel22-Jun-10 6:18 
AnswerRe: Javascript Print Function is not working Pin
Sandeep Mewara22-Jun-10 7:16
mveSandeep Mewara22-Jun-10 7:16 
Questionloading a simple text file in iframe Pin
netJP12L22-Jun-10 4:27
netJP12L22-Jun-10 4:27 
AnswerRe: loading a simple text file in iframe Pin
jintalPatel22-Jun-10 4:43
jintalPatel22-Jun-10 4:43 
GeneralRe: loading a simple text file in iframe [modified] Pin
netJP12L22-Jun-10 5:07
netJP12L22-Jun-10 5:07 
QuestionASP COOKIES Pin
graeme138322-Jun-10 3:36
graeme138322-Jun-10 3:36 
AnswerRe: ASP COOKIES Pin
Not Active22-Jun-10 4:17
mentorNot Active22-Jun-10 4:17 
AnswerRe: ASP COOKIES Pin
R. Giskard Reventlov22-Jun-10 4:49
R. Giskard Reventlov22-Jun-10 4:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.