• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1766
  • Last Modified:

Using convert function in VB.NET

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.

Thanks

0
parveenmehta
Asked:
parveenmehta
1 Solution
 
YaakovSCommented:
  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.
0
 
TheSipCommented:
your stuck in an infinite loop
0
 
parveenmehtaAuthor Commented:
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 ?
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now