By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 1,392 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

VB to C# converter

P: n/a
I tried several online converters. In many case they do the job, but
sometimes give some mess. I think that all converters I know are old, were
created for VS 2003 and do not understand new stuff from VS 2005. For
instance this block containing Using was not converted by anyone:

Public Shared Function GetSiteSettings() As SiteSettings
Using connection As New
SqlConnection(ConfigurationManager.ConnectionStrin gs("Personal").ConnectionString)
Using command As New SqlCommand("site_GetSiteSettings", connection)
command.CommandType = CommandType.StoredProcedure
connection.Open()
Dim settings As New SiteSettings(0, "", "", "", "", "", "", "",
0, 0, "", 0, "", "")
Using reader As SqlDataReader = command.ExecuteReader()
Do While (reader.Read())
settings = New SiteSettings(CInt(reader("SiteID")),
CStr(reader("SiteName")), CStr(reader("SiteSlogan")),
CStr(reader("SitePageTitle")), CStr(reader("MetaDescription")),
CStr(reader("MetaKeywords")), CStr(reader("ThemeName")),
CStr(reader("CopyrightCredits")), CInt(reader("EnableRegistration")),
CInt(reader("EnableUserThemes")), CStr(reader("SMTP")),
CInt(reader("RequiresAuthentication")), CStr(reader("AuthUsername")),
CStr(reader("AuthPassword")))
Loop
End Using
Return settings
End Using
End Using

Does anybody know any online converter written for VS 2005?

Thank you
Esha
Oct 3 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a
I don't know of all encompassing "free" converters outside of the one I
use - myself! Basically for syntax issues you should check out:

http://www.harding.edu/USER/fmccown/...omparison.html

Oh and quit crossposting - if you don't get an answer in one ng wait a
while (read - a day or two or more) and then post to another news
group.

Thanks,

Seth Rowe

esha wrote:
I tried several online converters. In many case they do the job, but
sometimes give some mess. I think that all converters I know are old, were
created for VS 2003 and do not understand new stuff from VS 2005. For
instance this block containing Using was not converted by anyone:

Public Shared Function GetSiteSettings() As SiteSettings
Using connection As New
SqlConnection(ConfigurationManager.ConnectionStrin gs("Personal").ConnectionString)
Using command As New SqlCommand("site_GetSiteSettings", connection)
command.CommandType = CommandType.StoredProcedure
connection.Open()
Dim settings As New SiteSettings(0, "", "", "", "", "", "", "",
0, 0, "", 0, "", "")
Using reader As SqlDataReader = command.ExecuteReader()
Do While (reader.Read())
settings = New SiteSettings(CInt(reader("SiteID")),
CStr(reader("SiteName")), CStr(reader("SiteSlogan")),
CStr(reader("SitePageTitle")), CStr(reader("MetaDescription")),
CStr(reader("MetaKeywords")), CStr(reader("ThemeName")),
CStr(reader("CopyrightCredits")), CInt(reader("EnableRegistration")),
CInt(reader("EnableUserThemes")), CStr(reader("SMTP")),
CInt(reader("RequiresAuthentication")), CStr(reader("AuthUsername")),
CStr(reader("AuthPassword")))
Loop
End Using
Return settings
End Using
End Using

Does anybody know any online converter written for VS 2005?

Thank you
Esha
Oct 3 '06 #2

P: n/a
Thank you Seth
What's wrong with crossposting? For instance my current question is related
to several newsgroups, so maybe one of the members of one of the groups has
an answer.
Sorry, I just do not know what and how I affect by crosspostings.

Esha
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
>I don't know of all encompassing "free" converters outside of the one I
use - myself! Basically for syntax issues you should check out:

http://www.harding.edu/USER/fmccown/...omparison.html

Oh and quit crossposting - if you don't get an answer in one ng wait a
while (read - a day or two or more) and then post to another news
group.

Thanks,

Seth Rowe

esha wrote:
>I tried several online converters. In many case they do the job, but
sometimes give some mess. I think that all converters I know are old,
were
created for VS 2003 and do not understand new stuff from VS 2005. For
instance this block containing Using was not converted by anyone:

Public Shared Function GetSiteSettings() As SiteSettings
Using connection As New
SqlConnection(ConfigurationManager.ConnectionStri ngs("Personal").ConnectionString)
Using command As New SqlCommand("site_GetSiteSettings",
connection)
command.CommandType = CommandType.StoredProcedure
connection.Open()
Dim settings As New SiteSettings(0, "", "", "", "", "", "",
"",
0, 0, "", 0, "", "")
Using reader As SqlDataReader = command.ExecuteReader()
Do While (reader.Read())
settings = New SiteSettings(CInt(reader("SiteID")),
CStr(reader("SiteName")), CStr(reader("SiteSlogan")),
CStr(reader("SitePageTitle")), CStr(reader("MetaDescription")),
CStr(reader("MetaKeywords")), CStr(reader("ThemeName")),
CStr(reader("CopyrightCredits")), CInt(reader("EnableRegistration")),
CInt(reader("EnableUserThemes")), CStr(reader("SMTP")),
CInt(reader("RequiresAuthentication")), CStr(reader("AuthUsername")),
CStr(reader("AuthPassword")))
Loop
End Using
Return settings
End Using
End Using

Does anybody know any online converter written for VS 2005?

Thank you
Esha

Oct 3 '06 #3

P: n/a
"Esha" <aa*@optonline.netwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Thank you Seth
What's wrong with crossposting? For instance my current question is
related to several newsgroups, so maybe one of the members of one of the
groups has an answer.
Sorry, I just do not know what and how I affect by crosspostings.
I would amend his suggestion to just say that one ought to cross-post
carefully, and judiciously.

In your particular case, I would say that the .csharp and .vb newsgroups
both seem on-topic and appropriate. But it's not clear to me that the
..general newsgroup was.

I very much *disagree* with his suggestion to wait a day or say after
posting in one newsgroup and then post to a different one to see if you get
a reply there. If there is indeed another newsgroup in which it's
appropriate to post, there's no problem cross-posting to that newsgroup as
well. Conversely, if no other newsgroup is an appropriate target for a
cross-post, no other newsgroup is appropriate for posting the same question
at a later time.

Minimal cross-posting can work very well, and is much more efficient use of
the newsgroups than "multi-posting" (that is, posting the same message in
different newsgroups at different times). When cross-posting, just the one
message winds up being sent, and people who read multiple newsgroups need
only read the message once (any decent newsreader will mark the message as
read in all newsgroups, once it's been read in just one).

Excessive cross-posting can be a problem in that it allows some topics to
bleed into inappropriate newsgroups, increasing the noise-to-signal ratio of
the off-topic newsgroups. So one should certainly be careful when
cross-posting. But there's no reason to refrain from it altogether.

I know that personally, one thing I've found is that a LOT of questions that
are really just .NET Framework questions get posted here in the .csharp
newsgroup. In fact, just as a rough guess, it seems like more than half the
questions in the .csharp newsgroup have nothing to do with the language
itself.

IMHO, this is inappropriate use of the newsgroup, but it's clearly the
community standard and I'm certainly not going to be the one to try to
change things. :) At the same time, it's clear that the actual
m.p.dotnet.framework newsgroup (where those sorts of questions seem more
on-topic to me) gets much less traffic than this one, and possibly has lower
readership as well. So when I have what is essentially a
language-independent framework question, I still cross-post to this
newsgroup, because that's where the action appears to be.

Anyway, that's a long way of saying that I think you could have left off
m.p.dotnet.general, but otherwise I personally see nothing wrong with your
cross-posting, and I doubt most other people do either.

Pete
Oct 3 '06 #4

P: n/a
Great ANSWER !!!
Thank you Peter

Esha

"Peter Duniho" <Np*********@NnOwSlPiAnMk.comwrote in message
news:12*************@corp.supernews.com...
"Esha" <aa*@optonline.netwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>Thank you Seth
What's wrong with crossposting? For instance my current question is
related to several newsgroups, so maybe one of the members of one of the
groups has an answer.
Sorry, I just do not know what and how I affect by crosspostings.

I would amend his suggestion to just say that one ought to cross-post
carefully, and judiciously.

In your particular case, I would say that the .csharp and .vb newsgroups
both seem on-topic and appropriate. But it's not clear to me that the
.general newsgroup was.

I very much *disagree* with his suggestion to wait a day or say after
posting in one newsgroup and then post to a different one to see if you
get a reply there. If there is indeed another newsgroup in which it's
appropriate to post, there's no problem cross-posting to that newsgroup as
well. Conversely, if no other newsgroup is an appropriate target for a
cross-post, no other newsgroup is appropriate for posting the same
question at a later time.

Minimal cross-posting can work very well, and is much more efficient use
of the newsgroups than "multi-posting" (that is, posting the same message
in different newsgroups at different times). When cross-posting, just the
one message winds up being sent, and people who read multiple newsgroups
need only read the message once (any decent newsreader will mark the
message as read in all newsgroups, once it's been read in just one).

Excessive cross-posting can be a problem in that it allows some topics to
bleed into inappropriate newsgroups, increasing the noise-to-signal ratio
of the off-topic newsgroups. So one should certainly be careful when
cross-posting. But there's no reason to refrain from it altogether.

I know that personally, one thing I've found is that a LOT of questions
that are really just .NET Framework questions get posted here in the
.csharp newsgroup. In fact, just as a rough guess, it seems like more
than half the questions in the .csharp newsgroup have nothing to do with
the language itself.

IMHO, this is inappropriate use of the newsgroup, but it's clearly the
community standard and I'm certainly not going to be the one to try to
change things. :) At the same time, it's clear that the actual
m.p.dotnet.framework newsgroup (where those sorts of questions seem more
on-topic to me) gets much less traffic than this one, and possibly has
lower readership as well. So when I have what is essentially a
language-independent framework question, I still cross-post to this
newsgroup, because that's where the action appears to be.

Anyway, that's a long way of saying that I think you could have left off
m.p.dotnet.general, but otherwise I personally see nothing wrong with your
cross-posting, and I doubt most other people do either.

Pete

Oct 3 '06 #5

P: n/a
Rowe,

What you suggest is multiposting. We don't like that in these dotnet
newsgroups. Crossposting gives us the change to see if it is answered
already in another newsgroup, therefore please don't ask for multiposting.

In my idea is this a sample of a perfect crossposted message.

Cor

"rowe_newsgroups" <ro********@yahoo.comschreef in bericht
news:11**********************@i42g2000cwa.googlegr oups.com...
>I don't know of all encompassing "free" converters outside of the one I
use - myself! Basically for syntax issues you should check out:

http://www.harding.edu/USER/fmccown/...omparison.html

Oh and quit crossposting - if you don't get an answer in one ng wait a
while (read - a day or two or more) and then post to another news
group.

Thanks,

Seth Rowe

esha wrote:
>I tried several online converters. In many case they do the job, but
sometimes give some mess. I think that all converters I know are old,
were
created for VS 2003 and do not understand new stuff from VS 2005. For
instance this block containing Using was not converted by anyone:

Public Shared Function GetSiteSettings() As SiteSettings
Using connection As New
SqlConnection(ConfigurationManager.ConnectionStri ngs("Personal").ConnectionString)
Using command As New SqlCommand("site_GetSiteSettings",
connection)
command.CommandType = CommandType.StoredProcedure
connection.Open()
Dim settings As New SiteSettings(0, "", "", "", "", "", "",
"",
0, 0, "", 0, "", "")
Using reader As SqlDataReader = command.ExecuteReader()
Do While (reader.Read())
settings = New SiteSettings(CInt(reader("SiteID")),
CStr(reader("SiteName")), CStr(reader("SiteSlogan")),
CStr(reader("SitePageTitle")), CStr(reader("MetaDescription")),
CStr(reader("MetaKeywords")), CStr(reader("ThemeName")),
CStr(reader("CopyrightCredits")), CInt(reader("EnableRegistration")),
CInt(reader("EnableUserThemes")), CStr(reader("SMTP")),
CInt(reader("RequiresAuthentication")), CStr(reader("AuthUsername")),
CStr(reader("AuthPassword")))
Loop
End Using
Return settings
End Using
End Using

Does anybody know any online converter written for VS 2005?

Thank you
Esha

Oct 3 '06 #6

P: n/a

"Esha" <aa*@optonline.netwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Thank you Seth
What's wrong with crossposting? For instance my current question is
related to several newsgroups, so maybe one of the members of one of the
groups has an answer.
Sorry, I just do not know what and how I affect by crosspostings.

Esha
In fact, traditional netiquette guides say to cross-post rather than posting
separately in different newsgroups. Crossposting is bad only when it is
indiscriminate.

Particularly on microsoft.public, it is hard to tell which of several
similarly named groups will be the active ones. And this is genuinely a
two-language question (VB and C#).
Oct 3 '06 #7

P: n/a
Sorry all, I didn't mean to start anything - I was under the impression
that both cross and multi posting where to be avoided whenever
possible. After reading your comments however, I see I was clearly in
the wrong.

Sorry Esha! I'll be quiet now :-)

Thanks,

Seth Rowe

Cor Ligthert [MVP] wrote:
Rowe,

What you suggest is multiposting. We don't like that in these dotnet
newsgroups. Crossposting gives us the change to see if it is answered
already in another newsgroup, therefore please don't ask for multiposting.

In my idea is this a sample of a perfect crossposted message.

Cor

"rowe_newsgroups" <ro********@yahoo.comschreef in bericht
news:11**********************@i42g2000cwa.googlegr oups.com...
I don't know of all encompassing "free" converters outside of the one I
use - myself! Basically for syntax issues you should check out:

http://www.harding.edu/USER/fmccown/...omparison.html

Oh and quit crossposting - if you don't get an answer in one ng wait a
while (read - a day or two or more) and then post to another news
group.

Thanks,

Seth Rowe

esha wrote:
I tried several online converters. In many case they do the job, but
sometimes give some mess. I think that all converters I know are old,
were
created for VS 2003 and do not understand new stuff from VS 2005. For
instance this block containing Using was not converted by anyone:

Public Shared Function GetSiteSettings() As SiteSettings
Using connection As New
SqlConnection(ConfigurationManager.ConnectionStrin gs("Personal").ConnectionString)
Using command As New SqlCommand("site_GetSiteSettings",
connection)
command.CommandType = CommandType.StoredProcedure
connection.Open()
Dim settings As New SiteSettings(0, "", "", "", "", "", "",
"",
0, 0, "", 0, "", "")
Using reader As SqlDataReader = command.ExecuteReader()
Do While (reader.Read())
settings = New SiteSettings(CInt(reader("SiteID")),
CStr(reader("SiteName")), CStr(reader("SiteSlogan")),
CStr(reader("SitePageTitle")), CStr(reader("MetaDescription")),
CStr(reader("MetaKeywords")), CStr(reader("ThemeName")),
CStr(reader("CopyrightCredits")), CInt(reader("EnableRegistration")),
CInt(reader("EnableUserThemes")), CStr(reader("SMTP")),
CInt(reader("RequiresAuthentication")), CStr(reader("AuthUsername")),
CStr(reader("AuthPassword")))
Loop
End Using
Return settings
End Using
End Using

Does anybody know any online converter written for VS 2005?

Thank you
Esha
Oct 3 '06 #8

P: n/a
A lot of posts, but only one suggestion to solving the actual question. I
don't have a suggestion to the question either, just musing over the thread.
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Sorry all, I didn't mean to start anything - I was under the impression
that both cross and multi posting where to be avoided whenever
possible. After reading your comments however, I see I was clearly in
the wrong.

Sorry Esha! I'll be quiet now :-)

Thanks,

Seth Rowe

Cor Ligthert [MVP] wrote:
>Rowe,

What you suggest is multiposting. We don't like that in these dotnet
newsgroups. Crossposting gives us the change to see if it is answered
already in another newsgroup, therefore please don't ask for
multiposting.

In my idea is this a sample of a perfect crossposted message.

Cor

"rowe_newsgroups" <ro********@yahoo.comschreef in bericht
news:11**********************@i42g2000cwa.googleg roups.com...
>I don't know of all encompassing "free" converters outside of the one I
use - myself! Basically for syntax issues you should check out:

http://www.harding.edu/USER/fmccown/...omparison.html

Oh and quit crossposting - if you don't get an answer in one ng wait a
while (read - a day or two or more) and then post to another news
group.

Thanks,

Seth Rowe

esha wrote:
I tried several online converters. In many case they do the job, but
sometimes give some mess. I think that all converters I know are old,
were
created for VS 2003 and do not understand new stuff from VS 2005. For
instance this block containing Using was not converted by anyone:

Public Shared Function GetSiteSettings() As SiteSettings
Using connection As New
SqlConnection(ConfigurationManager.ConnectionStri ngs("Personal").ConnectionString)
Using command As New SqlCommand("site_GetSiteSettings",
connection)
command.CommandType = CommandType.StoredProcedure
connection.Open()
Dim settings As New SiteSettings(0, "", "", "", "", "",
"",
"",
0, 0, "", 0, "", "")
Using reader As SqlDataReader = command.ExecuteReader()
Do While (reader.Read())
settings = New
SiteSettings(CInt(reader("SiteID")),
CStr(reader("SiteName")), CStr(reader("SiteSlogan")),
CStr(reader("SitePageTitle")), CStr(reader("MetaDescription")),
CStr(reader("MetaKeywords")), CStr(reader("ThemeName")),
CStr(reader("CopyrightCredits")), CInt(reader("EnableRegistration")),
CInt(reader("EnableUserThemes")), CStr(reader("SMTP")),
CInt(reader("RequiresAuthentication")), CStr(reader("AuthUsername")),
CStr(reader("AuthPassword")))
Loop
End Using
Return settings
End Using
End Using

Does anybody know any online converter written for VS 2005?

Thank you
Esha

Oct 3 '06 #9

P: n/a
Can't help you with an online converter that'll do this, but our converter
(Instant C#) produced the following - note that some items are out of
context, so some heuristics are used by the converter in these cases:

public static SiteSettings GetSiteSettings()
{
using (SqlConnection connection = new
SqlConnection(ConfigurationManager.ConnectionStrin gs["Personal"].ConnectionString))
{
using (SqlCommand command = new SqlCommand("site_GetSiteSettings",
connection))
{
command.CommandType = CommandType.StoredProcedure;
connection.Open();
SiteSettings settings = new SiteSettings(0, "", "", "", "", "", "", "",
0, 0, "", 0, "", "");
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
settings = new SiteSettings(System.Convert.ToInt32(reader["SiteID"]),
System.Convert.ToString(reader["SiteName"]),
System.Convert.ToString(reader["SiteSlogan"]),
System.Convert.ToString(reader["SitePageTitle"]),
System.Convert.ToString(reader["MetaDescription"]),
System.Convert.ToString(reader["MetaKeywords"]),
System.Convert.ToString(reader["ThemeName"]),
System.Convert.ToString(reader["CopyrightCredits"]),
System.Convert.ToInt32(reader["EnableRegistration"]),
System.Convert.ToInt32(reader["EnableUserThemes"]),
System.Convert.ToString(reader["SMTP"]),
System.Convert.ToInt32(reader["RequiresAuthentication"]),
System.Convert.ToString(reader["AuthUsername"]),
System.Convert.ToString(reader["AuthPassword"]));
}
}
return settings;
}
}
}

--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: VB to Python converter
"esha" wrote:
I tried several online converters. In many case they do the job, but
sometimes give some mess. I think that all converters I know are old, were
created for VS 2003 and do not understand new stuff from VS 2005. For
instance this block containing Using was not converted by anyone:

Public Shared Function GetSiteSettings() As SiteSettings
Using connection As New
SqlConnection(ConfigurationManager.ConnectionStrin gs("Personal").ConnectionString)
Using command As New SqlCommand("site_GetSiteSettings", connection)
command.CommandType = CommandType.StoredProcedure
connection.Open()
Dim settings As New SiteSettings(0, "", "", "", "", "", "", "",
0, 0, "", 0, "", "")
Using reader As SqlDataReader = command.ExecuteReader()
Do While (reader.Read())
settings = New SiteSettings(CInt(reader("SiteID")),
CStr(reader("SiteName")), CStr(reader("SiteSlogan")),
CStr(reader("SitePageTitle")), CStr(reader("MetaDescription")),
CStr(reader("MetaKeywords")), CStr(reader("ThemeName")),
CStr(reader("CopyrightCredits")), CInt(reader("EnableRegistration")),
CInt(reader("EnableUserThemes")), CStr(reader("SMTP")),
CInt(reader("RequiresAuthentication")), CStr(reader("AuthUsername")),
CStr(reader("AuthPassword")))
Loop
End Using
Return settings
End Using
End Using

Does anybody know any online converter written for VS 2005?

Thank you
Esha
Oct 3 '06 #10

P: n/a
Amdrit,

We are probably all sure than David answers this kind of questions.

:-)

Cor

"AMDRIT" <am****@hotmail.comschreef in bericht
news:eD*************@TK2MSFTNGP02.phx.gbl...
>A lot of posts, but only one suggestion to solving the actual question. I
don't have a suggestion to the question either, just musing over the
thread.
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
>Sorry all, I didn't mean to start anything - I was under the impression
that both cross and multi posting where to be avoided whenever
possible. After reading your comments however, I see I was clearly in
the wrong.

Sorry Esha! I'll be quiet now :-)

Thanks,

Seth Rowe

Cor Ligthert [MVP] wrote:
>>Rowe,

What you suggest is multiposting. We don't like that in these dotnet
newsgroups. Crossposting gives us the change to see if it is answered
already in another newsgroup, therefore please don't ask for
multiposting.

In my idea is this a sample of a perfect crossposted message.

Cor

"rowe_newsgroups" <ro********@yahoo.comschreef in bericht
news:11**********************@i42g2000cwa.google groups.com...
I don't know of all encompassing "free" converters outside of the one I
use - myself! Basically for syntax issues you should check out:

http://www.harding.edu/USER/fmccown/...omparison.html

Oh and quit crossposting - if you don't get an answer in one ng wait a
while (read - a day or two or more) and then post to another news
group.

Thanks,

Seth Rowe

esha wrote:
I tried several online converters. In many case they do the job, but
sometimes give some mess. I think that all converters I know are old,
were
created for VS 2003 and do not understand new stuff from VS 2005. For
instance this block containing Using was not converted by anyone:

Public Shared Function GetSiteSettings() As SiteSettings
Using connection As New
SqlConnection(ConfigurationManager.ConnectionStr ings("Personal").ConnectionString)
Using command As New SqlCommand("site_GetSiteSettings",
connection)
command.CommandType = CommandType.StoredProcedure
connection.Open()
Dim settings As New SiteSettings(0, "", "", "", "", "",
"",
"",
0, 0, "", 0, "", "")
Using reader As SqlDataReader = command.ExecuteReader()
Do While (reader.Read())
settings = New
SiteSettings(CInt(reader("SiteID")),
CStr(reader("SiteName")), CStr(reader("SiteSlogan")),
CStr(reader("SitePageTitle")), CStr(reader("MetaDescription")),
CStr(reader("MetaKeywords")), CStr(reader("ThemeName")),
CStr(reader("CopyrightCredits")), CInt(reader("EnableRegistration")),
CInt(reader("EnableUserThemes")), CStr(reader("SMTP")),
CInt(reader("RequiresAuthentication")), CStr(reader("AuthUsername")),
CStr(reader("AuthPassword")))
Loop
End Using
Return settings
End Using
End Using

Does anybody know any online converter written for VS 2005?

Thank you
Esha


Oct 3 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.