curiousvbnet
Programmer
Hi,
i have created in the same project two classes ;the first onis called TreeView_MT_GEN_SPE_ASSOCIEs and the second one is called candidat_descripteur.
In the TreeView_MT_GEN_SPE_ASSOCIES class i have created a public function called sansaccent and i want to use it in the candidat_descripteur class.
But i see i have an error message when i use it in the candidat_descripteur form(a reference to a non shared member requires an object reference').
could you tell me what i need to do to access without any problem to the sansaccent funtion.
Thanks a lot for all your help.
Best regards.
Nathalie
Here is the code i use until now
i have created in the same project two classes ;the first onis called TreeView_MT_GEN_SPE_ASSOCIEs and the second one is called candidat_descripteur.
In the TreeView_MT_GEN_SPE_ASSOCIES class i have created a public function called sansaccent and i want to use it in the candidat_descripteur class.
But i see i have an error message when i use it in the candidat_descripteur form(a reference to a non shared member requires an object reference').
could you tell me what i need to do to access without any problem to the sansaccent funtion.
Thanks a lot for all your help.
Best regards.
Nathalie
Here is the code i use until now
Code:
Imports System.Windows.Forms
Imports System.IO
Imports System.Drawing.Font
Imports System.Xml
Imports Application_Windows_Thesaurus.TreeView_MT_GEN_SPE_ASSOCIES
Public Class candidat_descripteur
Inherits System.Windows.Forms.Form
Private m_objConn As SqlConnection
Private objDS6 As DataSet
Private objDA6 As SqlDataAdapter
Public WriteOnly Property Connection() As SqlConnection
Set(ByVal Value As SqlConnection)
m_objConn = Value
End Set
End Property
[blue]Private Sub Enreg_cd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Enreg_cd.Click[/blue]
Dim strInsert_cd As String, objInsertNew_cd As SqlCommand, strSQLTERMES_Cd As String, drTerme As DataRow
Dim termecd_existe As Boolean
strSQLTERMES_Cd = " select Lib_CD from CANDIDAT_DESCRIPTEUR"
strInsert_cd = "INSERT into CANDIDAT_DESCRIPTEUR(Lib_CD) values ('"
strInsert_cd &= Replace(txtbox_cd.Text, "'", "''") & "')"
m_objConn.Open()
objInsertNew_cd = New SqlCommand(strInsert_cd, m_objConn)
objInsertNew_cd.ExecuteNonQuery()
m_objConn.Close()
[green] 'il faut verifier si ce terme n'existe pas déjà dans la table des candidats descripteurs[/green]
objDS6 = New DataSet
objDS6.Tables("TERMES").Clear()
objDA6 = New SqlDataAdapter(strSQLTERMES_CD, m_objConn)
objDA6.Fill(objDS6, "TERMES_CD")
For Each drTerme In objDS6.Tables("TERMES_CD").Rows
Dim strLibelle5, strLibelle6 As String
strLibelle5 = Replace(txtbox_cd.Text, " ", "")
strLibelle6 = Replace(strLibelle5, "-", "")
Dim libterme5, libterme6 As String
libterme5 = Replace((CType(drTerme.Item("Lib_CD"), String).ToUpper), " ", "")
libterme6 = Replace(libterme5, "-", "")
If SansAccent(strLibelle6.ToUpper) = SansAccent(libterme6) Then<-[blue]here i receive the message about the sansaccent function[/blue]
termecd_existe = True
End If
Next
End Sub
Private Sub Annul_saisie_CD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Annul_saisie_CD.Click
End Sub
End Class