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