Click here to Skip to main content
15,909,656 members
Home / Discussions / C#
   

C#

 
QuestionSQL Compact v3.5 ComboBox Not Populating from Query Pin
namelkcip19-Nov-11 8:16
namelkcip19-Nov-11 8:16 
QuestionSOS Something strange with memory Pin
Member 807559118-Nov-11 21:48
Member 807559118-Nov-11 21:48 
AnswerRe: SOS Something strange with memory Pin
OriginalGriff18-Nov-11 22:01
mveOriginalGriff18-Nov-11 22:01 
GeneralRe: SOS Something strange with memory Pin
Member 807559119-Nov-11 0:09
Member 807559119-Nov-11 0:09 
AnswerRe: SOS Something strange with memory Pin
Luc Pattyn19-Nov-11 7:28
sitebuilderLuc Pattyn19-Nov-11 7:28 
GeneralRe: SOS Something strange with memory Pin
Member 807559119-Nov-11 20:52
Member 807559119-Nov-11 20:52 
QuestionC# class that makes program read SqlConnection string from xml file Pin
Framework .l.18-Nov-11 17:36
Framework .l.18-Nov-11 17:36 
AnswerRe: C# class that makes program read SqlConnection string from xml file Pin
Wayne Gaylard18-Nov-11 19:31
professionalWayne Gaylard18-Nov-11 19:31 
Here

VB
Public Class Configuration
	Public Class ProgramClass
		Public Property Id() As String
			Get
				Return m_Id
			End Get
			Set
				m_Id = Value
			End Set
		End Property
		Private m_Id As String
		Public Property Name() As String
			Get
				Return m_Name
			End Get
			Set
				m_Name = Value
			End Set
		End Property
		Private m_Name As String
		Public Property DefaultCurrency() As String
			Get
				Return m_DefaultCurrency
			End Get
			Set
				m_DefaultCurrency = Value
			End Set
		End Property
		Private m_DefaultCurrency As String
	End Class

	Public Class ConnectionClass
		Public Property Provider() As String
			Get
				Return m_Provider
			End Get
			Set
				m_Provider = Value
			End Set
		End Property
		Private m_Provider As String
		Public Property [String]() As String
			Get
				Return m_String
			End Get
			Set
				m_String = Value
			End Set
		End Property
		Private m_String As String
	End Class

	Public Property Connection() As ConnectionClass
		Get
			Return m_Connection
		End Get
		Set
			m_Connection = Value
		End Set
	End Property
	Private m_Connection As ConnectionClass


	Public Property Program() As ProgramClass
		Get
			Return m_Program
		End Get
		Set
			m_Program = Value
		End Set
	End Property
	Private m_Program As ProgramClass


	Protected nav As XPathNavigator = Nothing

	Public Sub New()
		Me.Connection = New ConnectionClass()
		Me.Program = New ProgramClass()
	End Sub

	Public Function Open(providers As ProviderCollection, filename As String) As Boolean
		If Not File.Exists(filename) Then
			Return False
		End If

		Try
			Dim doc As New XmlDocument()
			doc.Load(filename)
			Me.nav = doc.CreateNavigator()


			Return True
		Catch
			Return False
		End Try
	End Function

	Public Overridable Function Read() As Boolean
		Try
			Me.nav = nav.SelectSingleNode("//connection")
			Me.Connection.Provider = Me.nav.GetAttribute("provider", "")
			Me.Connection.[String] = Me.nav.GetAttribute("connection_string", "")

			Me.nav = nav.SelectSingleNode("//program")
			Me.Program.Id = Me.nav.GetAttribute("id", "")
			Me.Program.Name = Me.nav.GetAttribute("name", "")
			Me.Program.DefaultCurrency = Me.nav.GetAttribute("default_currency", "")

			Return True
		Catch
			Return False
		End Try
	End Function
End Class


I just used developerfusion's converter application[^].

Next time you can go straight there. Smile | :)

Good luck.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman

GeneralRe: C# class that makes program read SqlConnection string from xml file Pin
Framework .l.18-Nov-11 19:46
Framework .l.18-Nov-11 19:46 
GeneralRe: C# class that makes program read SqlConnection string from xml file Pin
Wayne Gaylard18-Nov-11 19:51
professionalWayne Gaylard18-Nov-11 19:51 
GeneralRe: C# class that makes program read SqlConnection string from xml file Pin
Framework .l.18-Nov-11 19:55
Framework .l.18-Nov-11 19:55 
GeneralRe: C# class that makes program read SqlConnection string from xml file Pin
Wayne Gaylard18-Nov-11 20:00
professionalWayne Gaylard18-Nov-11 20:00 
AnswerRe: C# class that makes program read SqlConnection string from xml file Pin
OriginalGriff18-Nov-11 20:38
mveOriginalGriff18-Nov-11 20:38 
GeneralRe: C# class that makes program read SqlConnection string from xml file Pin
Wayne Gaylard18-Nov-11 20:57
professionalWayne Gaylard18-Nov-11 20:57 
GeneralRe: C# class that makes program read SqlConnection string from xml file Pin
OriginalGriff18-Nov-11 21:36
mveOriginalGriff18-Nov-11 21:36 
GeneralRe: C# class that makes program read SqlConnection string from xml file Pin
Wayne Gaylard18-Nov-11 21:44
professionalWayne Gaylard18-Nov-11 21:44 
QuestionAccessing a dynamically created drop down list Pin
Jon Myers18-Nov-11 9:21
Jon Myers18-Nov-11 9:21 
AnswerRe: Accessing a dynamically created drop down list Pin
Dan Mos19-Nov-11 8:05
Dan Mos19-Nov-11 8:05 
GeneralRe: Accessing a dynamically created drop down list Pin
Jon Myers19-Nov-11 10:21
Jon Myers19-Nov-11 10:21 
GeneralRe: Accessing a dynamically created drop down list Pin
Dan Mos19-Nov-11 10:31
Dan Mos19-Nov-11 10:31 
QuestionShutdown and Logoff System Events and Windows Services Pin
adrianojorge18-Nov-11 8:34
adrianojorge18-Nov-11 8:34 
QuestionRe: Shutdown and Logoff System Events and Windows Services Pin
Mark Salsbery18-Nov-11 10:08
Mark Salsbery18-Nov-11 10:08 
AnswerRe: Shutdown and Logoff System Events and Windows Services Pin
adrianojorge18-Nov-11 21:30
adrianojorge18-Nov-11 21:30 
GeneralRe: Shutdown and Logoff System Events and Windows Services Pin
Mark Salsbery19-Nov-11 6:21
Mark Salsbery19-Nov-11 6:21 
GeneralRe: Shutdown and Logoff System Events and Windows Services Pin
adrianojorge20-Nov-11 4:41
adrianojorge20-Nov-11 4:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.