[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Using convert function in VB.NET

Posted on 2006-05-23
Medium Priority
Last Modified: 2012-06-27
Experts i am writting VB.NET  code and i am trying to encryt the connection string.Following is the logic i am using but i am getting this error when i use the convert function.
Can you please quiclky help me on this.I am sure it will be a piece of cake for you.

Public Class Encryption
    Protected Friend Shared Function encryption(ByVal connectionString As String) As String
    Return Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(connectionString))
    End Function
End Class

Error::: Overload resolution failed because no accessible 'Convert' accepts this number of arguments.


Question by:parveenmehta

Expert Comment

ID: 16748095
  Maybe try doing the conversion first and then returning the value.

   You may want to post this in the VB.net section (http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/) you can try asking a moderator to move it there, as your more likely to get useful responses there.

Accepted Solution

TheSip earned 800 total points
ID: 16748426
your stuck in an infinite loop

Author Comment

ID: 16755005
I actually rewrote the code in C# and that solved the problem.But now i am stuck into another issue.
I am doing this conversion here
byte[] b=Convert.FromBase64String(System.Configuration.ConfigurationSettings.AppSettings["dbConString"].ToString());
Getting this error
Invalid length for a Base-64 char array
Any idea or any solutions ?

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Steps to fix “Unable to mount database. (hr=0x80004005, ec=1108)”.
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
Viewers will learn how to use the Hootsuite Dashboard.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

867 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