
como mando llamar la clase desde mi forma para insertar datos
Publicado por Rocio (1 intervención) el 26/10/2013 01:22:55
Buenas tardes,
Tengo una duda espero puedan apoyarme,
Estoy utilizando visual web developer 2005 express edition & visual basic(language)
y generé una clase la cual manda llamar mi cadena de conexión que configuré en un archivo .XML
como mando llamar mi clase de conexión desde mi forma para poder insertarlos a esa base de datos configurada.
-------------------------------------
----- rutina que tengo definida en mi clase
Public Shared ReadOnly Property getConStr()
Get
Dim conStr As String = Nothing
Dim xmlReader As New XmlTextReader(HttpContext.Current.Server.MapPath("bin") & "\ConfigurationPreferences.xml")
While xmlReader.Read
If xmlReader.NodeType = XmlNodeType.Element AndAlso xmlReader.Name = "ConStr" Then
conStr = xmlReader.ReadString : Exit While
End If
End While
Return conStr
End Get
End Property
--------------------------------------
---agregué un nuevo ítem que es un archivo .XML
<?xml version="1.0" encoding="utf-8" ?>
<Key>
<ConStr>Data Source=PAOLA-PC;Initial Catalog=REL_IND;Persist Security Info=True;User ID=sa;Password=12345678</ConStr>
</Key>
como importo esa clase que ya tengo definida y como grabar datos de usuarios????
utilizando lenguaje en visual basic??
Tengo una duda espero puedan apoyarme,
Estoy utilizando visual web developer 2005 express edition & visual basic(language)
y generé una clase la cual manda llamar mi cadena de conexión que configuré en un archivo .XML
como mando llamar mi clase de conexión desde mi forma para poder insertarlos a esa base de datos configurada.
-------------------------------------
----- rutina que tengo definida en mi clase
Public Shared ReadOnly Property getConStr()
Get
Dim conStr As String = Nothing
Dim xmlReader As New XmlTextReader(HttpContext.Current.Server.MapPath("bin") & "\ConfigurationPreferences.xml")
While xmlReader.Read
If xmlReader.NodeType = XmlNodeType.Element AndAlso xmlReader.Name = "ConStr" Then
conStr = xmlReader.ReadString : Exit While
End If
End While
Return conStr
End Get
End Property
--------------------------------------
---agregué un nuevo ítem que es un archivo .XML
<?xml version="1.0" encoding="utf-8" ?>
<Key>
<ConStr>Data Source=PAOLA-PC;Initial Catalog=REL_IND;Persist Security Info=True;User ID=sa;Password=12345678</ConStr>
</Key>
como importo esa clase que ya tengo definida y como grabar datos de usuarios????
utilizando lenguaje en visual basic??
Valora esta pregunta


0