How to use Prepare?
- From: Christian Romberg <cromberg@xxxxxxxxxxx>
- Date: Wed, 19 Oct 2005 09:15:00 -0700
Hi,
when using Prepare() on a SqlCommand, the SqlClient (unlike the
OracleClient) requires for certain types, that Size, Precision and/or
Scale have been set *explicitly* by the user.
The problem I have is, that I don't know in advance what values should be
stored.
So my approach is, to set the maximal value (e.g. 4000 for size for
DbType.String).
My questions are:
Does that matter at all when executing the Command?
If I specify 4000 but the string is just 3 characters long, would it have
been faster (or consume less memory) if I had specified some smaller value
instead of 4000?
What happens if my string exceeds 4000 characters?
Thank you in advance!
Christian
.
- Follow-Ups:
- Re: How to use Prepare?
- From: Frans Bouma [C# MVP]
- Re: How to use Prepare?
- Prev by Date: Re: Datatable.Select or DataView
- Next by Date: Re: Datatable.Select or DataView
- Previous by thread: Re: Problem connecting to Oracle database
- Next by thread: Re: How to use Prepare?
- Index(es):
Relevant Pages
|