Solved

OleDbDataAdapter and OleDbType.LongVarWChar

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
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…

830 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