Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 7th, 2004, 08:40 PM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default Syntax Help - Convert C# to VB.NET

Hi,

I'm trying to convert the following method to VB.NET

public static string get_setting(string name, string default_value)
{

NameValueCollection name_values
    = (NameValueCollection)ConfigurationSettings.GetConf ig("btnetSettings");
  if (name_values[name] == null || name_values[name] == "")
  {
    return default_value;
  }
  else
  {
    return name_values[name];
  }
}

After I declare name_values

I'm not sure how to handle this:

  name_values = (NameValueCollection)ConfigurationSettings.GetConf ig("somekeyinWebConfig");

Any ideas?
 
Old July 7th, 2004, 09:01 PM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Also for this method:

public static string format_db_date(object date)
{

 if (date.GetType().ToString() == "System.DBNull")
  {
    return "";
  }

  return ((DateTime)date).ToString("F");

}

How do I convert return ((DateTime)date).ToString("F") to VB.NET?

Thanks !
 
Old July 7th, 2004, 09:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

I have a link to convert C# to VB.NET: http://authors.aspalliance.com/aldot...translate.aspx. The program is not 100%, so don't expect it to be perfect.

Brian
 
Old July 7th, 2004, 09:33 PM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wow. Thanks, that's a start !





Similar Threads
Thread Thread Starter Forum Replies Last Post
convert C++ syntax to VB .NET hendyhanusin VB.NET 2002/2003 Basics 0 July 19th, 2007 09:52 PM
convert PHP to VB.NET or C# eugz VB.NET 4 April 24th, 2007 01:12 PM
convert dsr file from vb to vb.net Shashi001 VB Components 1 September 22nd, 2006 12:24 PM
What is the Equivalent Syntax in VB.NET r_taduri VB.NET 2002/2003 Basics 1 June 2nd, 2006 12:49 PM
Help - Convert from C# to VB.Net CrazyLegsCooper VS.NET 2002/2003 1 July 20th, 2003 10:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.