Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem w/parameterized sql stmt
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00661706
Message ID:
00665583
Views:
25
Hi Mike,

>You can do a lot but not with the some of the built in designers that require the table's layout. I've seen mention of making the provider more compatible with .NET but do not have any detail. Maybe someone in the know will chime in. You should check Rick Strahl's whitepaper on .NET Interop for Visual FoxPro at http://www.west-wind.com/presentations/VfpDotNetInterop/vfpDotNetInterop.htm. It has a section on OLEDB that mentions this problem.

I read Rick's article as well as some others and found that creating a dataset without paramters seems to be a safe bet. Being that my tables are small thats okay. From there, after looking at the VFP Toolkit for DotNet, I created a dataview and used a Find statement to get to the record I wanted. Not the optimal way to do it but Ill take what I can get for now.

Here's the code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OleDbDataAdapter1.Fill(DataSet11)
Dim dvHwHoa As New DataView(DataSet11.hwhoa)
dvHwHoa.Sort = "hpassword"
Dim dvRecNo As Integer = dvHwHoa.Find(TextBox1.Text)
If dvRecNo = -1 Then
TextBox2.Text = "Invalid password, please re-enter"
TextBox3.Text = " "
Else
Dim cHname As String = CType(dvHwHoa(dvRecNo)("Hname"), String)
Dim cHinit As String = CType(dvHwHoa(dvRecNo)("Hinit"), String)
TextBox2.Text = cHname
TextBox3.Text = cHinit
End If
End Sub

I created a NEW dataview here. Apparently one is created by default for each table in the dataset but I couldnt figure out how to reference it, so there may be some overkill here.

Also, after all this, I was able to pass values to another form from this one and run a parameterized query using a data reader instead of a dataset, so I may redo this one since the app only displays data only and the reader is more optimized.

Best regards,

Todd
The day you take complete responsibly for yourself, the day you stop making any excuses, thats the day you start to the top. - O.J. Simpson

Great advice from a questionable source...
Previous
Reply
Map
View

Click here to load this message in the networking platform