Solved

OleDbDataAdapter and OleDbType.LongVarWChar

Posted on 2016-08-26
4
69 Views
Last Modified: 2016-08-29
What do I specify for the length when I use OleDbType.LongVarWChar as the datatype?

  OleAdp.InsertCommand.Parameters.Add("@customer_desc", OleDbType.LongVarWChar, ???, "customer_desc")
0
Comment
Question by:HLRosenberger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 1

Author Comment

by:HLRosenberger
ID: 41771773
Same question for OleDbType.Date.
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 41771825
Same question for OleDbType.Boolean
0
 
LVL 32

Accepted Solution

by:
Robberbaron (robr) earned 500 total points
ID: 41772691
https://msdn.microsoft.com/en-us/library/xy9dbyk1(v=vs.110).aspx

Remarks
The Size is inferred from the value of the dataType parameter if it is not explicitly set in the size parameter.

so for fields that have defined sizes such as Date, Boolean etc, no length is required.

    Dim parameter As New OleDbParameter("Description", OleDbType.VarChar, 88)
    parameter.Direction = ParameterDirection.Output

the example shows for a varchar, the length should match the field length or the max size you will allow to be saved to the database.
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 41774615
Thanks!
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question