none
Trying to find next step to learn how to get data from database bound to text boxes in Form1 (in properties it shows as System.Windows.Forms.Form no items in form at this time). RRS feed

  • Question

  •  I have found in toolbox “BindingNavigator”, “BindingSource”, “DataGridView”,  “DataSet” .  and under SampleDatabaseWalkThrough Components these    “Pointer”, “CustomersTableAdapter”, “SampleDataBaseDataSet”, “OrdersTableAdapter”, “TableAdapterManager”

    In Visual Studio 2017 community I have created  a VB project SampleDataBaseWalkThru.vbproj             WPF

    Using Server Explorer  I have used Server Explorer / Data Connections  / SampleDatabase.mdf
    Then created two tables, “Customers” and “Orders”  with fields  showing under tab   dbo.Customers [Design]
    Does show in Script File’s box   dbo.Customers.sql  other tabs, App.config and Form1.vb[Design] and SampleDatabaseDataSet.xsd

    I do have sample data in both tables.


    Mark J

    Sunday, October 1, 2017 7:06 AM

Answers

  • Hi Mark,

    In your title you indicated Windows Forms then in the second paragraph mention WPF ???

    In short, the remainder of your question seems to be that you used the data source wizards which in turn created concrete classes which represent a master detail relation, something like this.

    If you are looking (it's unclear if this is what you are asking) to data bind a field to a control then it can be done via the Data Source window e.g.

    Select the control, drag to your form. If this is not what you are asking then please be more specific.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by PuzzledByWord Tuesday, October 3, 2017 7:28 AM
    Sunday, October 1, 2017 12:35 PM
    Moderator
  • Hi PuzzleByWord,

    According to your description, can you please help us to confirm what is your application, vb.net or WPF?

    And you want to get data from database bound to TextBox? what does it mean?

    Do you want to get some data from datagridview to Textbox or other? Please provide more detailed info here? Thanks.

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by PuzzledByWord Thursday, October 5, 2017 8:11 PM
    Monday, October 2, 2017 12:53 AM
    Moderator
  • As I stated in my first reply, select a property (field), from the drop-down select the control type e.g. TextBox and drag it to the form. There is a MSDN page that describes the same exact steps, and this MSDN page.

    See also, the following MSDN page which has a mixture of window forms and other project types on how to work with data as you are attempting too,


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by PuzzledByWord Thursday, October 5, 2017 8:04 PM
    Tuesday, October 3, 2017 9:41 AM
    Moderator
  • Hopefully that was the issue, please let us know if that solves your issues and even if it does the links I provided are still good pages to learn from.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by PuzzledByWord Thursday, October 5, 2017 7:51 PM
    Tuesday, October 3, 2017 2:08 PM
    Moderator

All replies

  • Hi Mark,

    In your title you indicated Windows Forms then in the second paragraph mention WPF ???

    In short, the remainder of your question seems to be that you used the data source wizards which in turn created concrete classes which represent a master detail relation, something like this.

    If you are looking (it's unclear if this is what you are asking) to data bind a field to a control then it can be done via the Data Source window e.g.

    Select the control, drag to your form. If this is not what you are asking then please be more specific.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by PuzzledByWord Tuesday, October 3, 2017 7:28 AM
    Sunday, October 1, 2017 12:35 PM
    Moderator
  • Hi PuzzleByWord,

    According to your description, can you please help us to confirm what is your application, vb.net or WPF?

    And you want to get data from database bound to TextBox? what does it mean?

    Do you want to get some data from datagridview to Textbox or other? Please provide more detailed info here? Thanks.

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by PuzzledByWord Thursday, October 5, 2017 8:11 PM
    Monday, October 2, 2017 12:53 AM
    Moderator
  • Karen Payne,

    Thanks, very much.

    looks like what I was trying to do.

    I get to Data Sources BUT unable to drag a textbox over to form. or anything else.

    must I do something to the data source first?  to connect to the database created in server explorer?

    seems my application info is   application Target framework is .NET framework  .NET Framework 4.6.1   and application type is  Windows Form Application. 

    Seems my biggest problem is NOT knowing enough of the terms and their definitions and uses. 

    Makes it hard to be clear in asking questions.

    I am learning as fast as I can.   the pix helped a lot to make it clearer.


    Mark J

    Tuesday, October 3, 2017 8:45 AM
  • As I stated in my first reply, select a property (field), from the drop-down select the control type e.g. TextBox and drag it to the form. There is a MSDN page that describes the same exact steps, and this MSDN page.

    See also, the following MSDN page which has a mixture of window forms and other project types on how to work with data as you are attempting too,


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by PuzzledByWord Thursday, October 5, 2017 8:04 PM
    Tuesday, October 3, 2017 9:41 AM
    Moderator
  • Karen,

    I had a system programmer check out my PC.  found problem.

    turns out I had all the tools to deal with SQL server.

    BUT I did not have SQL server. or Lite or Express.  So the tools connected with the JET engine.

    I will be downloading SQL server and the lite or express. next day.

    I will let all know the results.  after that.

    mark j.


    Mark J

    Tuesday, October 3, 2017 11:52 AM
  • Hopefully that was the issue, please let us know if that solves your issues and even if it does the links I provided are still good pages to learn from.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by PuzzledByWord Thursday, October 5, 2017 7:51 PM
    Tuesday, October 3, 2017 2:08 PM
    Moderator
  • Karen,

    I will respond as soon as I get SQL server and SQL lite installed.

    thanks again for all the helpful info.

    mark j


    Mark J

    Thursday, October 5, 2017 7:51 PM
  • Karen,

    I found out why I could sometimes do part of what you said and showed with controls. and sometimes not.

    turns out it seems due to NOT having SQL server or SQL lite,

    VS connected to "JET" so sometimes I was able to use Data Sources to get to a field in my database created in VS using Server explorer, and enter and save data in that item.

    BUT was unable to bind data bind to a control. 

    even if I got to the spot to drag a control to a form.

    Seems VS really tried hard to do what I wanted. seems VS used the JET engine from Access to get me this far.   I cannot blame VS for only being able to do this much, when I did not have SQL server or SQL lite.


    Mark J

    Thursday, October 5, 2017 8:04 PM
  • Cherry Bu,

    Is this how I check if my application is vb.net or WPF?

    seems my application info is   application Target framework is .NET framework  .NET Framework 4.6.1   and application type is  Windows Form Application. 

    as far as I can tell I will be  using vb.net when writing code.

    I have NOT written anything in the way of code in this app, so NOT sure how to tell.

    so how do I tell?

    any and every info helps.

    thanks Cherry,

    mark j.


    Mark J

    Thursday, October 5, 2017 8:10 PM
  • I really appreciate you coming back and indicating there was an issue because of SQL-Server not being installed as this will assist others who read this question and may very well help them out with a similar issue.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thursday, October 5, 2017 9:35 PM
    Moderator