B
Brian Toothill
I'm defining an SqlCommand (in C#), with the following members: -
..Connection = myConnection;
..CommandText = "INSERT INTO myTable (columnOne) VALUES (@col1)";
..Parameters.Add("@col1", SqlDbType.Char, 10, "columnOne");
In the Parameters.Add(), is it necessary to specify all that data? Can't I
just specify "@col1"? (I can't at the moment, I get an exception when I
call SqlDataAdapter::Update()).
Why do I need to specify the column data type, size, and name, to avoid an
exception?
..Connection = myConnection;
..CommandText = "INSERT INTO myTable (columnOne) VALUES (@col1)";
..Parameters.Add("@col1", SqlDbType.Char, 10, "columnOne");
In the Parameters.Add(), is it necessary to specify all that data? Can't I
just specify "@col1"? (I can't at the moment, I get an exception when I
call SqlDataAdapter::Update()).
Why do I need to specify the column data type, size, and name, to avoid an
exception?