I have a table (tblSpanishVerbs) of spanish verbs and need a function to return the corresponding English verb after passing the Spanish verb. For example, from below i want to pass the verb "comer" and return the verb "eat".
I am using Visual Studio Express 2008 and have imported a SQL Server database in to the project.
ID_verb SpanishInfinitive EnglishInfinitive
1 hablar speak
2 comer eat
3 partir leave
4 dar give
5 aprender learn
I am attempting to create a dataset and query the dataset with SQL with "SELECT * FROM tblSpanishVerbs WHERE SpanishInfinitive = 'comer'".
Here's my attempt with VBglish.
Public Function GetEnglishInfinitive(ByVal mySpanishInfinitive As String)
Dim myEnglishInfinitive As String = ""
Dim ds As New DataSet
'???How do i set up the dataset DS
For Each r As DataRow In ds.Tables(0).Rows
If r.Item("SpanishInfinitive").ToString = mySpanishInfinitive Then
TextBox1.Text = r.Item("EnglishInfinitive").ToString
Exit For
End If
Next
Return myEnglishInfinitive
End Function
Struggling with this basic concept so hope you can help.
Thanks!
John
I am using Visual Studio Express 2008 and have imported a SQL Server database in to the project.
ID_verb SpanishInfinitive EnglishInfinitive
1 hablar speak
2 comer eat
3 partir leave
4 dar give
5 aprender learn
I am attempting to create a dataset and query the dataset with SQL with "SELECT * FROM tblSpanishVerbs WHERE SpanishInfinitive = 'comer'".
Here's my attempt with VBglish.
Public Function GetEnglishInfinitive(ByVal mySpanishInfinitive As String)
Dim myEnglishInfinitive As String = ""
Dim ds As New DataSet
'???How do i set up the dataset DS
For Each r As DataRow In ds.Tables(0).Rows
If r.Item("SpanishInfinitive").ToString = mySpanishInfinitive Then
TextBox1.Text = r.Item("EnglishInfinitive").ToString
Exit For
End If
Next
Return myEnglishInfinitive
End Function
Struggling with this basic concept so hope you can help.
Thanks!
John