Results 1 to 9 of 9

Thread: vb.net and gridview

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2010
    Posts
    92

    vb.net and gridview



    can anyone help me how to add data if i click on Add button(user input)

    and view data in gridview control

    database already made using(sql server)
    ty

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: vb.net and gridview

    What is the process behind the add button.

    Are you adding directly to the database?
    Is the grid populated with a dataset?
    If populaated by a dataset are there Update, Insert and Delete statements defined on the data adapter?
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2010
    Posts
    92

    Re: vb.net and gridview

    ya i want it directly added to a database which takes user input from textbox's/combo box's

    sql server:-database name(mygary)

  4. #4
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: vb.net and gridview

    Then once the query fires to insert the new data you will need to requery the database to refill the grid. If it is a data set you might be able to call refresh on it.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2010
    Posts
    92

    Re: vb.net and gridview

    if the query fires once(insert into my gary values(......) i can't refill the gird so u can tell me how to do it with data set thanx

  6. #6
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: vb.net and gridview

    How do you fill the grid to start with?
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2010
    Posts
    92

    Re: vb.net and gridview

    bro i wanna use the dgv(datagrid view) only to view table enteres which are being made at sql server
    only to display those values
    if my table has 3 fields(id,name,password) containing value(gary,"mazzona","mazzone")
    so my datagrid view should display these values

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Feb 2010
    Posts
    92

    Re: vb.net and gridview

    if anyone here knows please reply
    thanx

  9. #9
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: vb.net and gridview

    You write a select statement to run against the database. That is what I'm asking you how do you fill the grid to start with. According to your comments you don't at this point.

    I suggest you Look at the FAQ at the top of the database fourm and look thought the ADO.Net tutorial.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width