Results 1 to 6 of 6

Thread: [RESOLVED] [2005] Refreshing Datas in DataGridView

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2007
    Posts
    48

    Resolved [RESOLVED] [2005] Refreshing Datas in DataGridView

    Hi,

    I've 1 TextBox, 1 Button and 1 DataGridView (Access DB) on a same one form. When pressing a Button I'm inserting TextBox datas to Access Database. But, I want to refreshing DataGridView table same time to show a new data. I can't do it

    Thank you,
    Yigit.

    My code is like this;

    Code:
            
    Dim cn As OleDbConnection
    Dim cmd As OleDbCommand
    Dim str As String
    
    cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Data.mdb;Persist Security Info=True;Jet OLEDB:Database Password=123")
    cn.Open()
    
    
    str = "INSERT INTO Table1(Name) values('" & TextBox1.Text & "')"
            cmd = New OleDbCommand(str, cn)
            cmd.ExecuteNonQuery()
    
            cn.Close()

  2. #2

    Thread Starter
    Member
    Join Date
    Feb 2007
    Posts
    48

    Re: [2005] Refreshing Datas in DataGridView

    Oh oke it resolved! Thx, Yigit.

  3. #3
    Fanatic Member onlyGirl's Avatar
    Join Date
    Sep 2006
    Location
    Houston, TX
    Posts
    743

    Re: [2005] Refreshing Datas in DataGridView

    Please mark your thread resolved if you don't need help.
    Using Visual Studio 2008

    Please mark your thread RESOLVED if you no longer need help.

  4. #4

    Thread Starter
    Member
    Join Date
    Feb 2007
    Posts
    48

    Resolved Re: [2005] Refreshing Datas in DataGridView

    Resolved

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Refreshing Datas in DataGridView

    Quote Originally Posted by YGTMLT
    Resolved
    You have to use the Thread Tools menu so it shows in the forum thread listing.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    Member
    Join Date
    Feb 2007
    Posts
    48

    Re: [RESOLVED] [2005] Refreshing Datas in DataGridView

    Thank you

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