O'Reilly logo

Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition by David Sceppa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Questions That Should Be Asked More Frequently

Q

How can I determine the values of the SqlDbType, Length, Scale, and Precision properties for a SqlParameter that matches up with a column in my table.

A

There are a couple simple ways to determine this information. The easiest way to check these properties for your column is to select the column in the Server Explorer window and check the Data Type, Length, Scale, and Precision properties in the Properties window. You can also create a SqlCommand to query for that column, call ExecuteReader with a CommandBehavior of SchemaOnly so that the SqlDataReader you receive contains only schema, no results. Then call GetSchemaTable and check the values of the SqlDbType, Length, Scale, and Precision properties ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required