C sharp - Convertir este codigo a vb.

 
Vista:

Convertir este codigo a vb.

Publicado por Andres (2 intervenciones) el 08/06/2007 19:20:44
Hola a todos espero alguien se apiade y me ayude a convertir este codigo de c# a vb, gracias!

using System.Data;
using System.Data.SqlClient;

public class Prueba
{

public static SqlConnection Conexion()
{
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["pruebaConnectionString"].ConnectionString;
SqlConnection conex = new SqlConnection(con);
return conex;

}
public static bool ValidaUser(string user, string password)
{
bool respuesta;
using (SqlConnection connection = Conexion() )
{
SqlCommand command = new SqlCommand("ValUser", connection);
command.CommandType = CommandType.StoredProcedure;
SqlParameter parametro_user= command.Parameters.Add("@user", SqlDbType.VarChar);
parametro_user.Value = user;
SqlParameter parametro_pass= command.Parameters.Add("@pass", SqlDbType.VarChar);
parametro_pass.Value = password;
command.Connection.Open();
SqlDataReader reader = command.ExecuteReader();
respuesta= reader.HasRows;
reader.Close();
}
return resp;
}


#region PRUEBA


public static DataSet ObtieneImagenes(string id)
{
DataSet ds = new DataSet();
using (SqlConnection connection = Conexion())
{
SqlCommand command = new SqlCommand("Imagenes", connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@id", SqlDbType.Int).Value = int.Parse(id);
command.Connection.Open();
SqlDataAdapter da = new SqlDataAdapter(command);
//SqlDataReader reader = command.ExecuteReader();
da.Fill(ds, "imagenes");
}
return ds;
}


#endregion

public static string ObtienePassword(string correo)
{
string respuesta="";
using (SqlConnection connection = Conexion())
{
SqlCommand command = new SqlCommand("Contrasena", connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@correo", SqlDbType.VarChar).Value=correo;
command.Connection.Open();
SqlDataReader reader = command.ExecuteReader();
if (reader.HasRows)
{
reader.Read();
respuesta = reader.GetString(0);
reader.Close();
}
}
return respuesta;
}


}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Convertir este codigo a vb.

Publicado por x (28 intervenciones) el 08/06/2007 19:31:07
http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx

con sus limitaciones pero al menos te ayuda, si no avientatelo a manita, sirve que aprendes, de hecho no esta dificil segun veo...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Convertir este codigo a vb.

Publicado por Andres (2 intervenciones) el 08/06/2007 19:42:42
Muchas gracias x te pasaste con la respuesta...si deseo aprender a programar con clases desde vb.net si tienes algun manual de clases que me puedas facilitar en link te lo agradeceria mucho.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Convertir este codigo a vb.

Publicado por x (28 intervenciones) el 08/06/2007 20:05:45
http://www.vb-mundo.com/tutorial_programacion/Visual-Basic-NET/Programacion-VBNET-OOP/970.htm

espero al menos leas ingles, lo descargue y se ve bueno (aun no lo he leido, pero algun dia :P)
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

IVAN DEMIR - Clubing (Oviedo) 5-10-2007

Publicado por IVAN DEMIR (1 intervención) el 26/10/2007 03:29:25
NECESITO CONVERTIR ESTO PARA QUE AL CLIQUEAR LO ENVIE AL ENLACE...GRACIAS.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar