how to VB to C# convert

How to convert following code VB to C#


Public Function GetAppNos(ByVal prefixText As String, ByVal count As Integer) As String()
Dim cnn As OracleConnection = New OracleConnection(ReplaceWithurconnstring)
Dim adp As OracleDataAdapter
adp = New OracleDataAdapter("select * from Application where APP_NO like '" + prefixText + "%'", cnn)
Dim daset As Data.DataSet = New Data.DataSet
adp.Fill(daset, "aaa12")
Dim temp As New List(Of String)
For i As Integer = 0 To daset.Tables(0).Rows.Count - 1
temp.Add(daset.Tables(0).Rows(i).Item(0).ToString())
Next
Return temp.ToArray
End Function
salamiaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kalpesh ChhatralaSoftware ConsultantCommented:
C# Code.

public string[] GetAppNos(string prefixText, int count)
{
	OracleConnection cnn = new OracleConnection(ReplaceWithurconnstring);
	OracleDataAdapter adp = default(OracleDataAdapter);
	adp = new OracleDataAdapter("select * from Application where APP_NO like '" + prefixText + "%'", cnn);
	System.Data.DataSet daset = new System.Data.DataSet();
	adp.Fill(daset, "aaa12");
	List<string> temp = new List<string>();
	for (int i = 0; i <= daset.Tables[0].Rows.Count - 1; i++) {
		temp.Add(daset.Tables[0].Rows[i][0].ToString());
	}
	return temp.ToArray();
}

Open in new window


you can also try below URL to convert your code.

http://www.developerfusion.com/tools/convert/vb-to-csharp/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.