Results 1 to 2 of 2

Thread: Adding data from local SQL

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    15

    Adding data from local SQL

    Hi there,

    Could some one please help me to attach data from SQl server? my code goes like this:

    private void button4_Click(object sender, EventArgs e)
    {
    SqlDataAdapter adp = new SqlDataAdapter

    (the name of the sheet that I like to attach is Main$)

    So, when the button 4 is executed, I want the Main$ is to appear on the datagrid... Thanks in advance.

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

    Re: Adding data from local SQL

    There are heaps of data access examples around. I suggest you read all about ADO.NET here to save you coming back with questions again and again. Note that when you click the "View Source" links it will show you VB.NET code, but there is a link to C# code at the top of that page. You may also like to download the C# 2003 101 samples from my signature, which will have data access examples included.
    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

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