Procedure expects a parameter which was not supplied.
Procedure expects a parameter which was not supplied.
(OP)
Hello, All.
Is there a way to make these two lines of code one line.
Thought it would be simple.... like
but that doesn't compile.
Visual Studio 2008. C#. Sql Server 2008.
The code is in a 'using (new SqlCommand comm)' clause which is in a Using Connection clause. Trying to utilize the dispose() benefits of the using clause.
Thanks, Everyone.
Patrick B
Is there a way to make these two lines of code one line.
CODE
comm.Parameters.Add(new SqlParameter("@p1",SqlDbType.VarChar,3)); comm.Parameters["@p1"].Value = textBox1.Text;
Thought it would be simple.... like
CODE
comm.Parameters.Add(new SqlParameter("@p1",SqlDbType.VarChar,3).Value = textBox1.Text);
but that doesn't compile.
Visual Studio 2008. C#. Sql Server 2008.
The code is in a 'using (new SqlCommand comm)' clause which is in a Using Connection clause. Trying to utilize the dispose() benefits of the using clause.
Thanks, Everyone.
Patrick B
RE: Procedure expects a parameter which was not supplied.
comm.Parameters.Add(new SqlParameter("@p1", textBox1.Text));
[/code
Rhys
"Technological progress is like an axe in the hands of a pathological criminal"
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe"
Albert Einstein
RE: Procedure expects a parameter which was not supplied.
CODE
Rhys
"Technological progress is like an axe in the hands of a pathological criminal"
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe"
Albert Einstein