Re: Assigning value to parameter in stored procedure
- From: "RobinS" <RobinS@xxxxxxxxxxxxxxx>
- Date: Wed, 28 Mar 2007 13:58:30 -0700
You have to add the parameters to the command object.
SqlCommand cmd = new SqlCommand();
cmd.Connection = myConnection;
cmd.CommandText = "mySpName";
cmd.Parameters.AddWithValue("@myParameterName",
float.Parse(textBox1.Text);
or this:
SqlParameter p = new SqlParameter();
p.ParameterName = "@myParameterName";
p.Value = float.Parse(textBox1.Text);
cmd.Parameters.Add(p);
Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
<jed@xxxxxxxxxxxxxxx> wrote in message
news:1175092168.410321.215190@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have tried
sqlCommand1.Parameters[0].Value = float.Parse(textBox1.Text);
but the debugger says that it cant see the parameter
How can i gain access to the parameter in C# EXpress.thanks in
advance(i am newbie).
.
- References:
- Prev by Date: Re: .NET Security
- Next by Date: Re: Scrolling WebBroswer works, but not when it has proper DOCTYPE!
- Previous by thread: Re: Assigning value to parameter in stored procedure
- Next by thread: create array of structs, accessed by enum
- Index(es):