[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

VB.NET / ADO.NET data entry design question

Asked by chlade in Microsoft Visual Basic.Net

Tags: bindings, cause, provider

I have done some programming with VB6 and ADO and am now getting into VB.NET and ADO.NET.  I have never been taught how to do things the best way; I have learned on the fly as best I can.

I am trying to create a simple screen whereby the user enters a Supplier number.  After entering the number, the system will pull up the supplier fields (name, address, etc) for editing.  The user can then click Save to update the records.

I want to allow the user to tab back up to the Supplier control, enter a new supplier number and have the program repopulate the fields with that new supplier number.  My problem is that when the program calls the "PopulateFields" routine the second time, I get an error related to databindings.

I am using a SQL statement to only select the supplier record that the user specified.  I don't need to pull all of them across over the network to edit just one.  There are thousands of supplier records and at most a user might edit 2 or 3 in one session.

All examples I see in VB books and online talk about binding to a recordset and navigating through all records.  Wouldn't this cause a lot of overhead?  I want to retrieve and edit one record at a time.

Attached is my code to do this.  Any and all comments are welcome as I am new to this and want to go about it in the best and most efficient way.  Again my problem right now is the databindings error mentioned above.

Thanks,
Chris

    Private Sub txtSupplier_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtSupplier.Leave

        If Trim(txtSupplier.Text) <> "" Then PopulateSupplierFields()

    End Sub

    Private Sub PopulateSupplierFields()

        Dim AdoStringSupplier as String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = SupplierDB.mdb"

        Dim SqlStr As String = "Select * FROM Suppliers " & _
            "WHERE Supplier = '" & txtSupplier.Text & "';"

        Dim cn As New OleDbConnection(AdoStringSupplier)
        Dim da As New OleDbDataAdapter(SqlStr, cn)
        Dim ds As New DataSet

        da.Fill(ds, "Suppliers")

        txtSupplierName.DataBindings.Add("Text", ds, "Suppliers.Name")
        txtSupplierAddr1.DataBindings.Add("Text", ds, "Suppliers.Addr1")

    End Sub
 
Related Solutions
Keywords: VB.NET / ADO.NET data entry desi…
 
Loading Advertisement...
 
[+][-]06/11/04 11:35 PM, ID: 11294680Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Microsoft Visual Basic.Net
Tags: bindings, cause, provider
Sign Up Now!
Solution Provided By: RonaldBiemans
Participating Experts: 4
Solution Grade: A
 
[+][-]06/11/04 11:56 AM, ID: 11291561Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/11/04 12:09 PM, ID: 11291680Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/11/04 12:44 PM, ID: 11291997Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/11/04 09:15 PM, ID: 11294344Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/16/04 06:59 AM, ID: 11324388Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/16/04 07:10 AM, ID: 11324494Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/16/04 07:14 AM, ID: 11324552Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/16/04 07:32 AM, ID: 11324804Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/16/04 07:37 AM, ID: 11324876Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/16/04 01:43 PM, ID: 11328797Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/16/04 01:44 PM, ID: 11328804Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/16/04 11:50 PM, ID: 11332048Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/17/04 07:50 AM, ID: 11335246Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/29/04 09:25 AM, ID: 12181553Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93