Solved

OleDbDataAdapter and OleDbType.LongVarWChar

Posted on 2016-08-26
4
65 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 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